I once had a female coworker tell me “I would give you a hug but I don’t want you to report me to HR.” I laughed and said I wouldn’t report her and accepted a hug.
Now of course giving hugs at work can be dangerous. It is easy for good intentions to be misinterpreted. The safest thing is to not give hugs, but I would rather be authentic, and if I get fired for being a human being that is ok with me.
For example, some people I worked with have told me very personal things and I could tell they were emotional about it. In general, people seem to trust me. So at times, I will ask someone who shared something personal with me “Is it ok if I give you a hug?” I have always gotten a yes and they gave me a hug.
Now I realize by talking about this I might be perceived as inappropriate. I always ask for permission before I do something, and only with someone that I consider a friend. Normally that person and I would have already gone to lunch or felt comfortable talking to each other outside of work.
My efforts to be kind usually are well-received. I have gotten 99% good feedback and even things like gifts and sweet notes. My goal is to ease people’s burden not only with technology but with whatever issue they might share with me. I am not trying to heal people, and I don’t act like a psychologist. I listen and then ask if they are asking me for advice. If they are, then I share it. If they don’t act like they are asking me for advice I shut up and just listen.
For the record, I have never reported anyone to HR no matter what they did to me. If someone does something that makes me feel uncomfortable I have a discussion with them. Plenty of times my coworkers have done things that made me feel uncomfortable. For example, female coworkers have: started a porno while I was in the room on their computer, told me they loved me, showed me their breasts, felt my body, and other things. I left those situations as quickly as possible. I am not excusing what they did, but I am not going to threaten their livelihood by a silly decision on their part.
Connecting with people always poses some risk. Just be careful and wise.