Hester views her "sin" quite differently that Dimmesdale does. Hester recognizes her sin as a violation of human law, and accepts the consequences of what she has done by living on the outskirts of "civilization" and by doing what she can to make the lives of others better. It is unclear whether she sees her sin as a violation of a "religious" law. In Chapter 17 she makes the famous argument/statement to Dimmesdale that "What we did had ahenb consecration of its own. We felt is so. We said to to each other." She almost makes an argument here that their act was "religious" through the use of the specific word "consecration," a word with very specific religious overtones. The key here is that they "felt" and "told" each other --- is feeling and telling enough to make something "right"? Certainly some ethical systems would agree. Because of this, Hester maintains a kind of balance that escapes Dimmesdale; she accept the punishment of man while not hiding from the wrath of God.
On the other hand, Dimmesdale recognies his sin as a violation not only of man's law but also of God's law. Dimmesdale defined himself through his ministry and his religion. When he "sinned" he changed his sense of himself and did not just violate a human law; he was a changed and defeated man, wracked by guilt and regret. His sin so changed him that he was never able to return to his previous life because his previous being wasn't there any more. I think he would have liked to believe what Hester told him about the "consecration" of their act, but it was outside the possibilites that his faith offered him.