I would argue that Mariam is most like Hassan in The Kite Runner and Dane O'Neill in The Thorn Birds. That was my argument in my previous answer here.
In this answer, I will provide a few more details to substantiate my thesis. In my opinion, Mariam, Hassan, and Dane are similar in that they share traits of compassion, selflessness, and loyalty. The text from all three novels substantiates this fact. Hassan is utterly devoted to Amir and Baba. As for Miriam, she becomes intensely devoted to Laila, Aziza, and Zalmai as time progresses. Meanwhile, Dane is devoted to Meggie (his mother) and Justine (his sister) from the very beginning. Later, Dane pledges his commitment to the Church and becomes Father Ralph de Bricassart's loyal understudy. Tragically, Dane dies without learning the truth about his paternal heritage.
One trait Hassan shares with Mariam is a rare perception, a deep insight into human nature and the workings of life. When the Taliban moves into Kabul, Rahim Khan urges Hassan to rejoice, but the latter understood that there would be no peace for the beleaguered city. Hassan's answer to Rahim Khan's exhortation is a simple and prophetic "God help the Hazaras now, Rahim Khan sahib."
Hassan's fears are realized when the Taliban banned kite-fighting (his favorite pastime) only a few weeks after taking over the Kabul region. The text tells us that, two years later, the Taliban massacred the Hazaras in Mazar-i-Sharif. Thus, Hassan had been right in his outlook. As for Mariam, the exchange between her and Laila after Rasheed's death is one of the most poignant moments in the novel.
When Laila begs Mariam to go with her and the children, Mariam refuses. Her simple answer is at once heartbreaking and damning in the truth it contains: "They chop off hands for stealing bread. . . . What do you think they'll do when they find a dead husband and two missing wives?" Mariam knows that neither of them will survive if they try to escape together. To console Laila, Mariam tells her friend to think like a mother.
Mariam dies to give Laila and her two children a chance at life. In giving herself, Mariam (like Hassan) dies in the knowledge that she has never betrayed her principles. Despite the cruelty of others (whether it be from Rasheed or the Taliban), Mariam is able to retain her humanity to the last. Her perception of what constitutes the most important things in life is unerring. This is also true for Dane; he dies knowing that his last act on earth is an unselfish one. In death, all three characters are able to transcend injustice, hatred, and cruelty.