Before you had your own child, did you ever go up to someone else's baby and give their hand a little squeeze or gently rub the peach fuzz on their head or their soft cute little fat cheek with the back of your finger? I bet if you're honest with yourself, the answer would be yes. I find that since I've become a mother, I don't do that to other babies anymore. I never know if the mom is concerned about that kind of contact so I opt to not do it at all just to be safe, but that's been since I was a mom. Before that, it never even occurred to me to be concerned about germs. Stranger still, I sometimes wonder if some moms are hurt when I don't lavish more attention on their babies by touching or wanting to hold them sometimes. I mean there's only so much oooing and ahing over a baby you can do to prove you think they are cute. Some parents like the attention they get from having a cute baby, so you just can't win with moms nowadays.
In the case that you describe at Target, and given your concerns, I would have probably smiled and nodded and gently taken the doll away from the stranger and put it in the diaper bag discreetly and moved on thru the line. If the stranger persisted to touch the baby, I would have smiled, nodded and covered the baby with a blanket where her hands weren't so easily accessible. And, as a last resort, I would have been honest and said "I don't mean to be rude. And I know you will probably think I'm worrying for nothing, but I get really anxious when people I don't know come into close contact with her because I don't want her to get sick. I hope you can understand. It's not personal. I feel the same way about anyone not in our immediate family. It's just a thing I have." and then just go on about your business. You will probably have hurt that person's feelings, but maybe they will think next time before they start touching a stranger's baby in the future.
To ease your mind a little, I will say that as many times as my children were touched by strangers, I cannot ever once say they came down sick as a result of that "stranger" contact. I'm not saying it's impossible, I'm just saying it's improbable. Not at 7 months anyway, not unless they have an immune system issue of course. I CAN give you examples of times my kids got sick from coming into contact with close friends and family though, and that's pretty much at any age.
Kids bring so much joy to others just by being lovable. They are young and cute and cuddly for such a short time. A gentle touch on the hand or the cheek was ok with me when my kids were young and they made it thru infanthood ok, germs and all. :-)