Yes. In fact, most obstetricians highly recommend it. Pregnant women can be more prone to gingivitis (gum bleeding and irritation) because some of the hormones cause an exaggerated response to plaque and bacteria. Furthermore, pregnant women can have an uptick in cavities if they are snacking more frequently.
There has also been an association of pregnant women with gum disease being more prone to pre-term births and low birth weight babies. Another important reason to get cavities addressed before the baby is born is that the bacteria that cause cavities are contagious and are frequently passed from mother to child.