All manner of hugging goes on in society in the US. For some people it is unwanted regardless of who the other person is. Autism spectrum comes to mind. How aggressive can person A be against person B to avoid the hug? Here is a recent post:
What is the basis for legal limits on response? I imagine A is allowed by law to aggress against B only to some proportionate extent. But proportionate in what terms? Of society, in which case A can't pepper spray B when B tries to hug A? The idiosyncrasies of A, in which case pepper spray would be justifiable, in my opinion.
They can use reasonable force. This is an objective definition: would a reasonable person think that the force was necessary in the circumstances. The fact that the actual person concerned may be paranoid, or autistic, or have suffered harm in the past, or ... is irrelevant.
The public policy reasons for this should be obvious: you are allowed to approach someone in a way that is culturally and situationally appropriate without having to be legally concerned that the particular person concerned may react unreasonably.
Law Stack Exchange is for educational purposes only and is not a substitute for individualized advice from a qualified legal practitioner. Communications on Law Stack Exchange are not privileged communications and do not create an attorney-client relationship.