If Hester doesn't get pregnant, it can be assumed that the town would not have found out that she had cheated on her husband. Remember, the town didn't know who her husband was. They just knew that she arrived before he did. Since he hadn't been seen for two years the people began to believe he had died at sea on the voyage over. The only reason people began to suspect that Hester had committed an adulteresses act was when she began with child. Without this growing visual sign of her sins, I think no one would have know.
If they never were caught, Hester would not have had to face the public humiliation of the scaffold and the letter. This means that Dimmesdale would not have to endure such a secret sin on his own. Since he was a holy man, I'm sure he would have felt a since or moral turmoil, but I don't think it would have been the same. Watching Hester and Pearl be shunned by the town, and not being able to say or do anything, is just the beginning of the minister's self imposed punishments. His sermons get better as a result of these punishments. He begins to understand the hidden sin in his parishioners, and they in turn love him even more for it. If Hester had not been pregnant, he may not have been the preacher he became by the end of the novel.
It just goes to show you- just because something seems all bad, doesn't mean that it will only result in bad.