Your dog doesn't sound very nice...
That's a very unjustified comment.
The dog may be nervous, or old, or just not happy with total strangers grabbing at him/her. A dog shouldn't have to put up with it -and anyway, it is only good manners to ask before you touch someone else's dog.
I have two very friendly dogs, and one anxious one. She panics if anyone she doesn't know, adult or child, approaches her. I have more trouble than enough with people who insist, "Oh - she'll be okay with me. Dogs love me". NOT MINE!
She's never bitten, but ends up shaking behind my legs and it spoils her for the rest of the day.
I m always delighted when people ask, complement children on their good manners and good sense, and tell them - you can stroke those two, but not this one because she's very shy."
OP- I don't think your dog sounds nasty at all. Just a dog that doesn't want to be manhandled.