I think it depends on what you mean by safe? Safe meaning you and the fetus can tolerate it, generally yes.
But there can be side effects of taking antibiotics, like enamel changes in the fetus depending on the week of fetal development. I have a friend who needs antibiotics for UTI and her infant had inferior enamel that several dentists linked to the antibiotics she took. I don't know what antibiotic she took.
If there are any behavioral changes you make to avoid needing them in the future, do it!
Follow Mothering