You haven’t really offended him. You see, rockruff, as are most dog-like pokémon, are extremely empathetic and loyal. So if you tell your rockruff he’s hurt you, even if he’s young and even if you said it nicely, he’ll immediately assume he did something terrible. In other words, he feels guilty, and he’s likely afraid of hurting you again.
Therefore, what you need to do is simple: teach him how to touch. As gently as you can, reach out for him when you see him and get him to come to you. Pet him gently, then teach him how to avoid rubbing his collar on you. For example, kneel down and have him come at you from the front, using your legs as leverage to reach your face. This may sound complicated, but it’s pretty easy to do if you employ a bit of positive reinforcement. That is, when he comes close and lets you pet him, give him a treat. When he reaches up and places his paws on you in a way you think is fine, give him another treat. Then herd him gently from there and give him treats whenever he successfully shows you affection in ways that don’t hurt you.
But above all else, be patient, as it might be a slow process to teach him. Having a first aid kit nearby may help too.
Best of luck!