The reader has to feel something for Mary Maloney in order to be engaged. She commits a murder, then finds herself in a tight spot because the house is full of detectives and uniformed cops investigating the crime. Her husband was a cop himself, which explains why the police are taking such an interest.
However, I think "sympathy" is too strong a term. Empathy would be more like it. The author uses several devices to create empathy with his character. Most importantly, he keeps the reader in Mary's point of view (POV) from beginning to end. Whenever we are in a character's point of view, we cannot help but emphasize with that character--regardless of how good or bad, how likable or unlikable, he or she might be.
A good example of this is Jack London's "To Build a Fire." The protagonist is not a likable or sympathetic character. He seems like a brutal, ignorant, selfish man--yet we empathize with him because we are confined to his POV up to the time of his death. We also empathize with him because of his motivation, which is simply to stay alive. We can empathize with any human or even with any animal if we are in that character's POV and the character is trying to stay alive.
This is the case with Mary Maloney. She has killed her husband in an explosion of emotion and now she wants to avoid being arrested for murder and possibly executed.
It was extraordinary, now, how clear her mind became all of a sudden. She began thinking very fast. As the wife of a detective, she knew quite well what the penalty would be.
That was fine. It made no difference to her. In fact, it would be a relief. On the other hand, what about the child? What were the laws about murderers with unborn children? Did they kill them both--mother and child? Or did they wait until the tenth month? What did they do?
Roald Dahl has cleverly augmented the reader's empathy by making his character six months pregnant. She is more concerned about her child than she is about herself. We like this in her. She is unselfish. She has the instincts of a mother, and any parent can empathize with her desire to protect her baby. In fact, there could hardly be a better way of engaging identification and concern for Mary Maloney than by making her six months pregnant. In was partly her husband's cold indifference to her condition that made her so bitterly angry in the first place.
Patrick Maloney's cold indifference is another way in which Dahl creates empathy for his wife. She worships him and has been slavishly devoted to him during all their years of marriage. Now she is going to present him with a child, which is the best gift this humble woman has to offer the man she loves. He picks this time to tell her he wants nothing more to do with her. If she were totally crushed, we might feel sympathetic--but that would be another story, wouldn't it? Instead she reacts with fury and bashes him over the head with a frozen leg of lamb. We empathize with her but do not feel sorry for her. We feel like congratulating her on finally becoming a real person instead of a doormat. We want to see her get away with her crime, and we feel a sense of satisfaction and closure when she manages to do so.
In general, we do not approve of wives killing their husbands; but Dahl characteristically treats the whole episode with a dash of humor which assures us that this is only a story not to be taken too seriouosly. This is another reason why we empathize rather than sympathize with Mary.