Don't touch Thai people on thier head?

I'll be going to Thailand next year for a family friend's wedding and I've been reading up (watching YouTube videos) on travel tips and one that keeps popping up is to not touch Thai people on thier head. Is that a thing?

I ask for a couple of reasons. First is that outside of an emergency first aid scenario, I can't imagine touching a stranger's head. Like do people just walk up to random Thai people and pat them on their head? Obviously enough foreigners have touched Thai people's heads where it has become a thing to tell them not to do, but I'm American and struggling to think of a time where I've purposely touched the head of someone who wasn't a significant other or a family member.

Second as a white American if some random person walked up to me and touched my head, I would definitely respond negatively. Do Thai people respond especially negatively?

The whole thing seems on par with telling someone not to shove a sandwich into an ATM. Not only was I not planning on it, it genuinely wouldn't have occurred to me to do so. I'm just so genuinely confused by the whole thing.