When the rioting crowd threatens Thornton at Marlborough Mills, Margaret instinctively throws herself in front of him and acts as Thornton's human shield. This climax of the novel contains multiple levels of situational irony.
First, Margaret believes it's a woman's "high privilege" and a "natural instinct" to insert herself in a dangerous situation to defend someone under threat, since it's universally accepted that a man would never harm a woman. (So, by throwing herself in front of Thornton, she believes the rioters will be afraid to hurt her and she'll thereby defuse the crowd's violent intentions toward Thornton.) Whether Margaret's perception of this "privilege" is accurate or not, she appears to genuinely believe it. Yet, though she, and readers, expect that her bold action will disarm the angry crowd, it doesn't work; shockingly, someone throws a pebble and injures Margaret anyway.
Ironically, Margaret ultimately does de-escalate the situation in the very act of getting hurt; when they see Margaret unconscious and bleeding, the crowd dissipates in shame. So, Margaret achieves her aim of preventing Thornton from getting hurt, though not at all in the expected way.
Another layer of irony is that Margaret's instinctive action spurs Thornton to propose marriage to her the next day—decidedly the opposite of her intentions. At this point, Margaret doesn't have romantic feelings for Thornton (or, at least, she's unaware of any or doesn't admit them to herself), and her behavior certainly wasn't calculated to show any special regard for a man she still doesn't entirely like or trust. During their heated conversation after the proposal, in fact, Margaret says that if she'd had time to consider her actions, she would have more readily sympathized with any man in the crowd rather than with Thornton. So the fact that Margaret finds herself in the position of having to reject a marriage proposal from Thornton, after behaving in a way that people wrongly interpret as a lover's instinct, is deeply ironic.
Early in the novel, when the Hales are still living in Helstone, Margaret expresses a dislike of “shoppy people," or people who've made money in trade, while talking with her mother. To show her disdain, she alludes to a children's nursery rhyme:
I think we are far better off, knowing only cottagers and labourers, and people without pretence [...]. I’m sure you don’t want me to admire butchers and bakers, and candlestick-makers, do you, mamma?
"Shoppy" was a 19th-century pejorative for people in retail trade. Shopkeepers were neither gentlefolk (born into propertied status) nor commoners (like "cottagers and labourers"). As such, this emerging class didn't fit tidily into the established social hierarchy. In Victorian England, where everyone knows their place, Margaret's dismissiveness and reluctance to associate with tradespeople seems to be connected to this social ambiguity. The disdain also seems to be a form of snobbery, as tradespeople's newer wealth is characterized as "pretence," unlike the wealth accumulated over generations by the aristocracy.
Margaret alludes to the English nursery rhyme "Rub-a-Dub-Dub" when she refers to "butchers and bakers, and candlestick-makers." The rhyme was published in a children's songbook in 1798, though it dates back earlier, and it seems to have originated as a way to teach listeners not to associate with those—like shady merchants—who enjoy morally questionable activities ("three men in a tub," or peep-show). By the time of the novel, the line "butchers and bakers, and candlestick-makers" seems to have resonated with the broader cultural belief that tradespeople weren't very respectable—hence Margaret's disgust.
There's also a note of situational irony here because Margaret soon moves to Milton and has no choice but to associate with "shoppy people"—and as she gets to know them, her opinion of them gradually changes from disdain to deep respect and friendship.
After Margaret's mother dies, Margaret not only takes on the role of comforter and sustainer of the entire family, but essentially does so through the expected actions of a clergyman—her father's former role. Because Mr. Hale's former position as Church of England priest was such a major part of his identity, and his abandonment of the priesthood is the primary driver of the Hales' move to Milton, it's ironic when Margaret suddenly and unexpectedly assumes aspects of that role herself. She does this while her father whimpers and her brother weeps over Mrs. Hale's body, instinctively reciting scripture and ministering to the grieving family:
The night was wearing away, and the day was at hand, when, without a word of preparation, Margaret’s voice broke upon the stillness of the room, with a clearness of sound that startled even herself: ‘Let not your heart be troubled,’ it said; and she went steadily on through all that chapter of unspeakable consolation.
"That chapter" refers to the Gospel of John chapter 14, in which Jesus goes on to promise his disciples that he will prepare a place for them in his Father's house, and that he is "the way, the truth, and the life." That Margaret suddenly recites this chapter from memory "without a word of preparation," and with startling confidence and clarity as she goes "steadily on," strongly implies that she is occupying the role that a clergyman would traditionally hold at a parishioner's deathbed—reciting one of the Bible passages most commonly used to console mourners. Again, given Mr. Hale's background, this is something that readers would expect Margaret's father to do, whether or not he's still serving as an official parish priest; yet it's Margaret who does the work of spiritual consolation, presumably having watched her father do it over the years. Margaret's striking assumption of a priestly role further establishes her character as a self-denying caregiver and supports the novel's theme of women's agency.
When Margaret sees her brother Frederick off at the train station, Thornton happens to pass by and see them from a distance. Since Frederick could be arrested as a mutineer, the Hales have kept his existence secret, meaning that when Thornton sees Frederick with Margaret, he assumes the young man must be Margaret's lover. However, readers know that it's just her brother, creating a moment of dramatic irony.
The very falsehood that stained her, was a proof how blindly she loved another—this dark, slight, elegant, handsome man—while he himself was rough, and stern, and strongly made. He lashed himself into an agony of fierce jealousy.
This quote gives Thornton's perspective—he assumes Margaret has been hiding a secret lover, and her secrecy shows that she really loves this man. The dramatic irony lets readers enjoy some understated humor at Thornton's expense. It's especially funny that Thornton is ragingly jealous of the fact that Margaret appears to prefer Frederick's looks to his own.
The irony also creates darker suspense. Thornton's jealousy makes it clear just how strongly he feels for Margaret, so it's ominous that his false assumption about Frederick's identity will damage Margaret in Thornton's eyes. Readers also must wonder whether Thornton will blow Frederick's cover and end up getting him arrested.