Hello, this is Dr. Zoe. Yes, you can safely deworm a pregnant dog.
I recommend use fenbendazole (Panacur) which can be purchased OTC. (Amazon link: http://www.amazon.com/Panacur-Canine-Dewormer-2-gram/dp/B00028ZLDG/ref=sr_1_3?ie=UTF8&qid=1334773746&sr=8-3). But it goes by weight. You need to give the appropriate amount for her weight once daily for 3 days in a row. This is a safe, effective broad spectrum dewormer that will clear roundworms, hookworms, whipworms and giardia.
i was told that this would help stop worms in puppies
It is appropriate to deworm the mother, but it probably will not stop the worms in the puppies. It may decrease the amount, though. Puppies getting worms is a natural part of the worm's cycle. The puppies will still need to be properly dewormed. Some like to start at 3-4 weeks of age with pyrantel and repeat this every 3 weeks until a puppy is about 3 - 4 months of age. I advocate deworming the mother!