The whole "hugging" thing can be confusing and awkward. I mostly just follow the other person's lead. I won't shrink away from a hug, but I don't offer either.
I've learned from awkward mistakes.
Years ago, I worked at a small company where a few of the people had known each other since high school. A woman hugged the male boss on his birthday, so I did, too. I later realized that she had been a close friend of the family for many years. I was just a newcomer. It wasn't a huge deal; I suspect that guy has a little AS in him anyway. But as soon as I started to hug him, I was aware that I was doing the wrong thing, because of the nervous laughter from other people. Sometimes it's hard to tell what is the right thing to do, especially when you don't have time to think about it.
I don't know where I fit on the spectrum, but I'd be interested to know how often this kind of confusion happens to NTs. I mean, they can't get it right every time, can they?