Hmm, the problem with trying to understand body language is that it can vary from person to person, and from situation to situation. IMO I've gotten okay at reading it, and I've been told that I've become decent at projecting the right signals. Here's a few general concepts that I've read from multiple sources.
Most body language is either dominant or submissive. It also tends to relate back to sex, eating, babies, play, and fighting. There's more then that, but it's hard to think of it all off the top of my head.
Regarding touch, normally it's used to indicate emotional closeness. Everyone has a bubble of personal space - a space around them that is viewed as theirs. Highly dominant people tend to want more space (think of the high powered CEO with the gigantic office), while more submissive people are willing to accept less (the tiny cubicles of the peons working for the CEO).
When unwelcome people come into 'your' space, it feels very uncomfortable. It can be viewed as a challenge, as the person is invading 'your' space. Generally people try to give each other enough room, and ignore the feelings of challenge when it's obviously impossible to do so (i.e. crowded subway). Sometimes it is a challenge though, someone saying that the space around you is theirs, that you must submit to their claim of dominance. You can see this when people are really mad at each other - they'll be standing so close their noses almost touch, screaming at each other. And of course physical brawling is a pretty major violation of personal space.
Letting people into your space willingly is an indication of trust and acceptance. You're letting your guard down, allowing them to get close enough to attack you, because you trust them not to. When people get close to you in this context, they're trying to be friendly, to test to see if you trust them.
It's also important to think of what accepting touch indicates in both circumstances. In the first, it indicates extreme submission, that you are so submissive, and they are so dominant, that you literally are entitled to NO personal space at all. This is a very unpleasent feeling, which is why people tend to get so upset when others get too close. In the second, accepting touch indicates that yes, you do trust them, that you are friendly.
So in the case of the camp-sort-of-gay acquaintance, he's probably trying to indicate that dispite the fact that he's contradicting you, there's no hard feelings. A good way to test this is to touch him back the same way he touched you. If he gets upset, then it was a dominance touch. If he's neutral or gets more friendly, then it was a friendly touch.
With the doctor, he's also probably trying to reassure you. Most doctors know that some people find them scary, so some of them do stuff to try to reassure their patients. He's likely talking about something fairly personal with you, so he may be trying to indicate that what he's saying shouldn't be regarded as an attack. However, using the touch test from the previous example probably wouldn't be a good idea. In the doctor's office, the doctor is by definition the one in change, and so clearly the dominant one. Letting someone touch you is a submissive behaviour, and so could threaten the doctor's control of the situation. There's also the issue of professional distance - doctors get in real legal trouble if they get too emotionally close to their patients. So he probably won't react well regardless of the context.
A better test would be to explain that you feel very uncomfortable when he touches you. It feels like an invasion of your space, and you would like it if he stopped. If he was trying to reassure you with his touching, then he will agree - after all, you just told him that it was having the opposite effect. If he resists your request, then it probably was at least partially a dominance touch.
I find it amazing that some NT's can do all this calculation subconciously.