Clearly your question focuses very closely on two very important themes that are self-evident from the very beginning of Hester's account. However, what is interesting, as in much of Hawthorne's work, is to examine who has sinned and who is serving penance. Often, considering such questions are not as easy as they first might appear. Although clearly Hester has been identified as a sinner and is serving penance very openly, she manages to convert her mark of shame into a mark of pride, and it is worthwhile considering if her love for Dimmesdale offsets her sin. Dimmesdale, in contrast, is not publicly identified as a sinner and does not serve penance, but he makes his own penance for himself, carving a copy of the scarlet letter into his own breast and letting his guilt lead to his sickness and eventual death.
However, an alternative approach is to see the novel as a criticism on Puritan society and how it unfairly punishes a weak and vulnerable single woman and thus it is the representatives of the authority in the community that have sinned. Hawthorne is critical of the hypocrisy of both Bellingham and Wilson, who preach simplicity yet make no sacrifice in terms of their own comfortable lives.
Thus when we consider sin and penance, a number of interesting questions are yielded which are not easy to answer, and in attempting to answer them we often find the debate more confused and complicated than the apparently surface simplicity we are given on first reading the story.