No it doesnt hurt the baby. I get it too, if your laying down & coughing an sneezing I suggest sit up because that could be the problem.
How far along are you?
And you shouldn't worry! I have asthma really bad and have had allergies/cough/cold reallybad this year. II've been sick twice with horrible coughing and sneezing since I've been pregnant. Doc said everything is fine that the baby won't be hurt.
I was really afraid to take any meds for coughing or anything but he said its safe to take robitussin (which doesn't really help me lol) and take my meds for asthma like I normally would. I just sucked on a bunch of cough drops and took benadryl and Tylenol lol!!
Hope this helped! GL!