My dog always greets people but then they keep trying to stroke his head and put their hands over him and he backs away.
They often think this is weird. Why would he come up if not for a stroke?
Well he doesn't like his head being stroked and doesn't like hands over his head.
Understanding consent from dogs is important and more often than not they don't approach strangers for strokes at all but just put up with them.
I keep telling people to not put their hands over dogs heads. 🤷♀️