I have both a heightened sensitivity to pain and pressure/anything touching my skin, along with psychological issues to being touched, which are unrelated to the former. Sometimes I'm okay with hugs, particularly if I know and feel affection for that person. At other times, especially when I'm upset, I cringe at being hugged. There have been occasions in the past where it would actually hurt, because the person was much stronger than me or resorted to "bear" hugs.
If you cringe at being hugged, I suggest you avoid it completely!
You are allowed to to that. You have that right.
I always avoid it, because I am simply not a "touchy-feely" kind of person, and resent it that a total stranger assumes I would want bodily contact with them.
I didn't know what to do about it until I met someone years ago who has osteogenesis imperfecta. Being hugged by someone could actually literally break her ribs. When someone comes towards her, she holds out a hand and says "Very gently, please. I break easily!"
Now, I don't do that because it would be lying, but seeing her do this made me realize that I have the right to refuse to allow a stranger to touch me if I choose. So, if I don't want to be touched, I move back, and say something like "virtual handshake, please" with a nice smile, and I hold my hand out and move it up and down in the air. Or, I might even hug the air in front of me and say, "Virtual hug!".
I find that if I do this with a nice tone of voice and a smile no one ever takes it badly. I did this long before the Pandemic, but it is even easier now post-Pandemic.