How to Get People to Stop Talking to Your Dog in Public
The thing is, you can't just freak out on people and say all that to them or they'll think you're crazy so I've started taking a more subtle approach. When a person comes up to my dog and says "Who's a good boy? WHO'S A GOOD BOY?!" I say "It's a she, and she says you're invading her personal space right now. We came to the park for a walk, not to be molested by strangers." Most people get the hint to back off and I don't have to resort to physical violence.
I think this is something that a lot of people don't think about. They just let strange people walk up and rub their dogs and try getting to know them all while the dog is just looking for a good place to drop a turd. If you notice your dog is resenting you, this could be the reason. You need to start standing up for your dog in these situations and help give a voice to the voiceless.