Hawthorne opens "The Custom House" with an allusion to a previous work of his own, Mosses from an Old Manse:
It is a little remarkable, that—though disinclined to talk overmuch of myself and my affairs at the fireside, and to my personal friends—an autobiographical impulse should twice in my life have taken possession of me, in addressing the public. The first time was three or four years since, when I favored the reader—inexcusably, and for no earthly reason, that either the indulgent reader or the intrusive author could imagine—with a description of my way of life in the deep quietude of an Old Manse.
Mosses from an Old Manse is a collection of sketches, or short stories. The work began with a description of the "Old Manse" (or mansion) where Hawthorne lived when he wrote the stories. The reference allows Hawthorne to emphasize his own role as an author. There is an assumption that the reader might have previously read Mosses, and the narrator wants to draw attention not to the sketches themselves but rather to the autobiographical material he used to frame the work. Although most modern readers have probably not read Mosses before reading The Scarlet Letter (the latter is much more famous), "The Custom House" is something like a sequel to the autobiographical material in Mosses. The narrator, who is almost indistinguishable from Hawthorne himself, claims that he doesn't like to talk about himself much. But baked into this allusion is the idea that readers are following along with the adventures of this author, like they would with their favorite fictional characters. As a writer interested in making a living by writing (rather than working in a Custom House, say), Hawthorne had a vested interested in building a loyal reader base.
The allusion also allows the narrator to immediately introduce the idea of allegory into The Scarlet Letter. Most of the sketches in Mosses were allegorical, and the thing that pulled them all together was the frame narrative. By referring immediately to this structure, the narrator in The Scarlet Letter suggests that the "main" narrative will really be about something else.
In "The Custom House," the narrator describes how he was ousted from his position as Surveyor. To make sense of what happened, he uses a simile alluding to Washington Irving's "Legend of Sleepy Hollow":
Meanwhile the press had taken up my affair, and kept me, for a week or two, careering through the public prints, in my decapitated state, like Irving's Headless Horseman; ghastly and grim, and longing to be buried, as a politically dead man ought. So much for my figurative self. The real human being, all this time, with his head safely on his shoulders, had brought himself to the comfortable conclusion that everything was for the best; and, making an investment in ink, paper, and steel-pens, had opened his long-disused writing-desk, and was again a literary man.
The Headless Horseman is a character in "The Legend of Sleepy Hollow." This character is the legendary ghost of a Hessian soldier who was killed in battle during the American Revolution; he supposedly haunts the village of Sleepy Hollow, riding around with his head detached and searching for his grave. The narrator notes that he, like the Headless Horseman, is "politically dead." He seems to be getting at the fact that neither of their political attachments matter anymore. Irving published "The Legend of Sleepy Hollow" in 1819, and it is set in 1790, soon after the Constitution established that the American Revolution was truly over. The Hessian army had aided the British during that revolution, but by 1790 they were irrelevant to the American political landscape. The Hessian soldier haunts Sleepy Hollow because while he should leave American soil, his death has trapped him there.
The simile that the narrator of "The Custom House" uses is, of course, a bit dramatic. The narrator is not dead, and he is not exactly bound to soil where he is not a citizen. But it is true that he suddenly finds himself in a place where he is all but irrelevant politically. The Whig government has pushed Democrats like the narrator to the sidelines. He continues for a few weeks to work as a Surveyor in the Custom House, but the newspapers are going after him to such a degree that his ousting seems inevitable. It does not matter how well he does his job if the Custom House has turned into a Whig institution with no place for him.
The reference also allows the narrator to suggest that he can be more effective as a fiction writer who analyzes national history than he can be as a government bureaucrat. The "real human being" beneath the trappings of public office is not like the Headless Horseman, the narrator writes of himself. He is not too upset about being chased out of office because the change allows him once more to embrace his real identity as "a literary man."
In Chapter 8, the narrator uses an allusion to the Bible to describe Governor Bellingham:
The wide circumference of an elaborate ruff, beneath his gray beard, in the antiquated fashion of King James's reign, caused his head to look not a little like that of John the Baptist in a charger.
In the Gospel of Mark, John the Baptist dies because a woman, Herodias, exacts vengeance on him for denouncing her marriage. The details are a bit complicated, but the allusion relies on a general familiarity with them. Herodias's daughter, Salome, dances for her stepfather. Pleased with her performance, he grants Salome a wish. Herodias urges her to wish for John the Baptist's head on a plate (or "charger"). Salome gets her wish, John is executed, and the head is served up.
The allusion has several layers of meaning. First is the idea that Hester, the woman Governor Bellingham has wronged, will get revenge just like Herodias. Hester does not ask Pearl to have the Governor executed, but Pearl is nonetheless integral to the way this chapter challenges Governor Bellingham's power over the mother and daughter. Hester and Pearl appear before the Governor because he wants to take Pearl away from Hester. He claims that Pearl's moral education is compromised by Hester's sin. Pearl indeed refuses to give him the answers he wants to hear about her own understanding of Puritan doctrine, and it seems that Hester and Pearl will be torn apart. At the last minute, Dimmesdale intervenes. Just as Salome dances before her stepfather, Pearl dazzles Dimmesdale into advocating for her to stay with Hester. The Governor seeks to abuse his considerable power over Hester and Pearl, but they do not let him get away with it as he did when Pearl was first born. The allusion allows the novel to make the point that the women Puritans seek to control may be more powerful than they expect.
The allusion also foreshadows that English aristocrats will eventually lose their power in the colonies. The governor's "ruff"—a frill worn around the neck in the style of an old English king—marks him as an English aristocrat more than an American. By comparing the ruff to the plate on which John the Baptist's head was served to Salome, the novel taunts English aristocrats for thinking that they have all the power. Just as Herodias finds a way to get her revenge against a man who seems to be far more powerful than her, the narrator knows that the American colonies will win the Revolution even from their position as the underdog.
In Chapter 10, the narrator describes "the leech and his patient," or Chillingworth and his life-sucking psychological torture of Dimmesdale. An allusion to John Bunyan's Pilgrim's Progress allows the narrator to emphasize how completely Chillingworth turns Dimmesdale's home into a house of horror:
Sometimes, a light glimmered out of the physician's eyes, burning blue and ominous, like the reflection of a furnace, or, let us say, like one of those gleams of ghastly fire that darted from Bunyan's awful doorway in the hillside, and quivered on the pilgrim's face. The soil where this dark miner was working had perchance shown indications that encouraged him.
In Bunyan's extraordinarily popular Christian allegory, a pilgrim aptly named Christian undergoes a long series of trials on his way to the Celestial City, or heaven. One of the trials involves passing through the gates of hell and walking through the Valley of the Shadow of Death. The "awful doorway in the hillside" the narrator describes is the gateway into the Valley of the Shadow of Death. Light usually symbolizes truth and revelation in the novel. For instance, the meteor that streaks across the sky in Chapter 12, while Hester, Dimmesdale, and Pearl stand together on the scaffold at night, foreshadows the day when they will stand together on the scaffold under the light of day. In this instance, by contrast, the narrator compares the light in Chillingworth's eyes to the fires of hell. Sin and evil seem to fuel the fire that shines out of them. This one instance where light is associated with evil does not weaken the effectiveness of the motif by which light is associated with truth and clarity. Rather, it underscores Chillingworth's status as a deceiver. Someone who associates light with truth and clarity might think they see good reflected in his eyes. In fact, Dimmesdale and most of the townspeople trust Chillingworth. This trust allows Chillingworth to "mine" deep in Dimmesdale's heart and home without being suspected of treachery.