Should You Always Let Strangers Pet Your Dog?
This is for dog lovers who think all dogs value petting as a training or social reward, I challenge you to go out to any rural area where there are feral dogs and find one that willingly approaches you and stands underneath your hand to be petted on the head. This photo is from a study done in Italy about people's reactions to having a stranger approach them and pet them on the head. The results are in...nobody wanted a stranger to make contact with them in this way.
The truth is that dogs need to learn to value petting. It's not hard wired like their innate merit of food. A dog can live their whole life without being petted, and be quite happy by doggy standards.
When we factor in dogs who are cautious, suspicious, under-socialized, fearful, etc...head petting, or any physical contact, is the last thing timid or fearful dogs want.
Be your dog's advocate. If she is cautious around new people or downright scared of them, put your dog's needs first. Tell the approaching invader to stand quietly and wait for the dog to come to them. In some circumstances, it better just to say that your dog will take a rain check on being petted today.