An allegory is a story in which the characters or events stand for something other than what appears in the story itself. As such, an allegory functions on at least two levels; it is the story itself, and it is also the thing it stands for. For example, the Orwell book Animal Farm can stand alone as a story, but it is also about the communist revolution in early twentieth-century Russia.
Nathaniel Hawthorne's The Scarlet Letter is not usually characterized as an allegory. However, if we think of an allegory as being essentially a systematic expression of symbolic meaning, then we can say that the character of Hester Prynne is allegorical. Prynne is an allegory, or symbol, for the idea of sin and resulting effect of that sin on the sinner and society in general. Hester commits an obvious, unchallenged sin (adultery), but the dramatic power of the novel lies in how she develops as a character in relation to this sin and the way colonial New England reacts to her.
Prynne's strength lies in her inner character. Although she is publicly scorned and humiliated, she continues to grow as a person and to care about the well-being of others. Several other characters, who do not possess this internal strength, gradually weaken and degenerate: The Reverend Dimmesdale, who cannot maintain the weight of his unconfessed guilt, and Roger Chillingworth (Prynne's actual husband), who is fatally engulfed in his own desire for revenge.
Hawthorne's allegorical message is that a repentant, confessed sinner can continue to grow as a person, while hidden guilt or a secret desire for revenge will ultimately destroy someone. He also implies that society's moral judgement is not necessarily an accurate measure of a person's character. Hester, so publicly ridiculed, is morally superior to every other major character in the work.