>>390496050
There are no obligations to headpat but many will do it as a form of greeting so in those cases any other form of recognition will also suffice.
If you want someone to stop headpatting you have to tell them to stop. Likewise you can headpat anyone for any other reason you want and it's up to them to indicate that they don't want it.