I am not entirely sure that we can correctly describe this rich and complex tale as an allegory, as really allegories are much simpler tales where the writer makes one point by having each character and event correspond with something else outside of the literal meaning that fits his or her purpose. However, we can point towards the allegorical significance of this text by refering to the treatment of sin, knowledge and what it is to be human, which is of course a massive theme in this novel.
We can argue that the story of Hester and Dimmesdale can be compared to that of Adam and Eve and their expulsion from the Garden of Eden because of their sin and gained knowledge. Sin is shown to result in exile and pain, but also we can see that it results in knowledge about the meaning of human identity. What is interesting is the way that Hester and Dimmesdale seem to gain distinct advantages because of their sin and suffering. For example, Hester's exile and shunning gives her a "passport into regions where other women dared not tread" which allow her to think about Puritan society and herself more strongly than anybody else. For Dimmesdale, his guilt and sin give him a strong connection with other sinners, "sympathies so intimate with the sinful brotherhood of mankind, that his heart vibrates in unison with theirs." Hester and Dimmesdale are therefore shown to be better off in some ways than the Puritan elders with whom they are implicitly compared. They see sin as a threat to their way of life and try to suppress and eradicate it, as shown through the shunning of Hester. Yet Puritan society is shown to be absolutely stagnant and without life, whereas Hester and Dimmesdale show that sin can actually lead to maturity, empathy for others and a development of character.
One allegorical reading of this incredible novel could therefore relate to the state of mankind and his/her relationship with sin, which allows Hawthorne to directly comment on some of the shortcomings in Puritan society.