This is a bit like that thread we had here recently, about people adjusting others' clothing. I'm quite a tactile person and when my mobility and balance were normal, I'd often hug and be hugged. But after I started needing a stick to walk there were a few times when I got swept into an unexpected hug, risking a fall and injury, and found that I needed to speak quite sharply to make the person let go of me.
It's another of those things where you might get advised to consider how the other person feels, what they mean, whether they knew that hugging wasn't safe. But with sudden hugs it's not just about those things. It's also about whether I fall into a busy road and I know people for whom it's about whether bones get dislocated.
For me the hug-danger has greatly reduced since I started using a wheelchair. Both because I'm far less likely to fall and because it makes my disability far more visible. These days, when somebody wants to hug me, phe tends to approach quite cautiously. Except for a small minority who stroke and fondle me. Perhaps they're trying to show how unprejudiced they are, or how much they care about me, or something. It makes me feel invaded, dirtied and irritated! but I try to keep a gracious face pinned on. It's nothing that a shudder and a change of shirt won't cure.