If cavity is small you can get it done filling it is safe. if cavity is deep we need x-ray before we plan out extraction. generally we tried to avoid x-ray during pregnancy. so you can try with short course of antibiotics if problem not solved with some protection you can get it done extraction.