You know when someone approaches your dog and reaches out patting them ontop of their head? I always wonder; do they really think; that your dog enjoys this? As your dogs head bobs up and down; and their eyes squint I wonder what they are thinking. "Oh ya, that feels great; please keep slapping me on the head." I really don't get how anyone can look at a dogs reaction to this and think that they enjoy it.
That said; not only is swapping a dog ontop of the head a strange thing to do, most dogs do not appreciate being pet ontop of the head by strangers. You will notice as you reach out with your hand over a dogs head they usually sink. Not all dogs sink but most do some degree of "please don't reach over my head." Reaching over a dog is a dominant gesture; very rude and an unwanted behavior in the dog world.
When you meet a dog, put your hand out palm up. If they are cool with that; reach forward under their head and scratch their neck of chest. They will definitely be happier.