I've been hugged a few times by doctors. One was a psychiatrist, I had had a proper melt down whilst trying to insist that yes I did have a mental health problem, I needed to see someone about CFS. I was so upset, and shouted that I was sick of people not believing me. He knelt down in front of me, looked me in the eye and said, "I believe you. We will get this sorted, I promise", and gave me a hug. I needed that hug.
Then when I was pregnant and under the CFS team, knowing it would be the last time I saw my specialist (transfer to adult) he gave me a hug and wished me well.
Then recently when I had been told that I needed another operation, and I burst into tears saying that I was 21 and so tired of having all these health problems, the lovely gynea gave me a quick hug as he gave me a box of tissues, and agreed with me that it was bloody unfair, but he could help with one part of it if I would let him.
None of those have felt inappropriate.