It is preferable to avoid surgery during pregnancy, however, if surgery is needed, the best time to schedule this is during second trimester (weeks 13-24), because this will not expose an early fetus to drugs, and it's still too early to provoke a premature labor. A recent study published in the Oxford Journal suggests that regional anesthesia should be used in preference to general anesthesia where appropriate.
Chances are you'll visit the dentist at some point during your pregnancy. If possible, try to plan your dental visit after weeks six through nine when your baby's internal organs are developing.
If you are having dental surgery that requires anesthetics, these may make you jittery and can create palpitations, especially with the normal changes in the heart that accompany pregnancy. However, while this is an inconvenience, it is temporary and will not harm your baby.
Unless you have a specific allergy, drugs in the penicillin category (penicillin G, ampicillin, etc.) are safe to take during pregnancy, and the same is true for antibiotics in the cephalosporin category (Keflex, etc.). Most types of erythromycin are also safe, as is vancomycin (for those with penicillin allergies).
Macrodantin is commonly prescribed for urinary tract infections during pregnancy. Although this antibiotic has been known to cause serious anemia in rare cases, the benefit far outweighs the risk.
For upper respiratory infections involving sinusitis, pharyngitis, or other non-viral infections, the drug of choice is penicillin.