Not all dogs appreciate touchy/feely affection, they're individuals just like people. Patience, do not allow the barking, correct it firmly/verbally each time it occurs, do not force petting/affection on her, with time she may or may not accept petting/affection, or she may have been poorly bred, genetically deficient which determines her nerve bag temperament, genetics can't be changed, only somewhat controlled by an experienced handler/owner/family, and/or abused in the past.
All of these are just guesses, however, since you haven't supplied any info on her past history. Obviously there is no way YA can give any responses, without being there and seeing exactly what is transpiring and knowing the individual dog more thoroughly.
Have your vet refer you to a behaviorist/trainer, before she injures someone, you're sued, dog is removed at your expense and possibly euthanized.
Also make sure she is constantly supervised, when others are around, do not allow others to approach her and/or surprise her, especially small children, that may not understand. Teach a child by word and example that animals are to be treated with care. Do not allow hitting, teasing, or other harassment.which may end badly for those that do, it's your responsibility to keep her and all others safe from harm by whatever means necessary.
If it doesn't work out you may have to resign yourself to refraining from any touchy/feely contact, as well as not others approach her, or re-home her with someone that has the experience/knowledge to handle her properly.Use only verbal praise when she performs as you wish, firm verbal.correction as needed. NILIF.
Supervise. Keep them in your vision at all times or physically separated--from everyone. And we mean at all times...
Anticipate. A dog only has a few ways of protesting. He can move away, hop up on furniture, or go under a bed. Once the dog has done this, he has no other means to stop anyone other than a bark, growl, or nip. If you see your dog retreating from anyone, stop that them! Anticipate problems before they happen. Do not expect your dog to tolerate something you wouldn't.
Follow through. If you say it, mean it. If you tell someone to stop bothering the dog, enforce that. If you tell the dog to sit, make him. All things are easier if everyone including the dog know that you mean what you say, and say what you mean.