I have had both good and bad experiences with hugs and other touch in therapy. One T used it against me to control and manipulate me and my emotions.
Awesome T gives hugs at the end of every session and any time I have the courage to ask but I have to ask because we are still working on it being OK for me to have needs and a voice. He will also hold me which has been amazing to our work together. Once I ask him to hold me he comes over to the far side of the couch and puts a pillow up to his side and I can move in and out of being held for the rest of the session.
To me the thing that makes any touch in therapy safe or unsafe is that the client in some way or another needs to initiate/consent and it has to be unconditional.