Stephenie Meyer explains this in detail on her website. I'll paraphrase here. Vampires were once human, and therefore are very similar to humans in many ways. Vampires have venom-based fluids in their bodies much like we have fluids in our bodies (tears, blood, lubricants in our cells and other tissue). Therefore, vampires are able to be aroused just as humans are, and male vampires have bodily fluids that carry genetic information and can fertilize a human egg. However, not many vampires have ever mated with a human before, as being that close and intimate with a human usually resulted in death for the human. So whereas female vampires are "frozen" and infertile, male vampires still carry genetic information in their semen, and are capable of producing offspring with a human, if they can mate without killing that human, and if the human can survive the pregnancy.
See Stephenie Meyer's site for more details. The link is posted below.
Rosalie cannot have children because she is a vampire. She does not have a monthly cycle anymore and when she became a vampire she has no more heart beat which meant she had no more blood pumping through her body. Bella is pregnant because she became pregnant before she became a vampire and thus had the baby while she was human.
No, Rosalie can not have children. This is because she us unable to have a monthly cycle. When she was changed into a vampire her heat beat was stopped, as well as any and all other vampires. Now that the heart no longer works to pump blood all over the body and provided oxygen there is no way that it's possible for her go through the cycle over and over again. Bella becomes pregnant since she's still able to reproduce and Edward still has the ability to pass on genetics.
Girls bodies constantly change, and when girls have children their bodies have to change. And since Bella is still human she can have children but Rosalie is constantly stuck at her stage and can't change therefore she can't have children. Boys bodies don't have to change to have a child therefore Edward can have a child with a human (Bella)
The premise is that although Edward's growth has stopped, he had viable sperm frozen in time at the point of being changed into a vampire. Although I don't understand why exactly, apparently semen was passed to fertilize Bella's egg, which was alive of course. It doesn't work the same way with Rosalie because her reproductive organs are forever frozen and cannot release eggs.