It is your job to do what's best for you and your dog
When you have a cute dog, lots of people will try to pet your dog.
I know it may sound mean but my concern is the well being of the dog so here it goes:
Those who ask to pet your dogs are doing so for their own enjoyment.
You are paying for your dog's food, training, medical care, and you are the one who need to live with your dog.
These people who ask to pet your dog on the street do not care about any of that.
They do not think about what is best for you or your dog.
If your dog becomes reactive, fearful, aggressive, anxious..., if your dog becomes impossible to walk on leash, if your dog becomes a crazy jumper, you are the one who have to deal with these problems.
Please understand the followings:
You are not obligated to let anyone touch your dog. It is not rude to say no. Even if that person looks upset/disappointed/mad, it is only because they cannot get what they want. It is not your job to make sure a stranger always get what he/she wants. But it is your job to make sure you do what is best for your dog.