Just like people, dogs appreciate being invited into another person or dog's space with politeness rather than having a stranger run up to them and grab their ears or head.
How many of us would put up with a total stranger doing that to us or to our children?