MAD "on paper" prevents either side from going far enough to provoke the other into using nukes, but even then it's fundamentally flawed because it works on the assumption that both sides are both rational and believes the other side to be rational, as well as that both sides understands the others red lines well enough.
Already Reagan realised that isn't necessarily true - after Able Archer '83, he realised that the Soviet leadership seemed to genuinely believe that the US might be prepared to carry out a first strike, and that Able Archer got dangerously close to convince them one might be imminent. It's one of the things he noted as a reason to get in the room with them and negotiate.
If you believe the other side is irrational (whether or not that is because you are irrational), and think they're about to strike, MAD turns from a deterrence into a reason to try to preempt to ensure you're the "least destroyed" by hitting harder, sooner.
It's demonstrably the case that attacks can take place between nuclear powers and not escalate to war. Why do you think that is?
Nuke-owning countries' leadership seems to have become more and more unhinged and less rational, predictable, or honorable over time. Putin already threatened to use nukes if the conflict they caused themselves crossed their own border. It didn't happen, but the threat was there. The US' leadership is unhinged and irrational. etc.