There are a number of amusing videos of Russian missile launches failing spectularly. I shudder to imagine such a failure with missile with a nuclear warhead. On the other hand, such a failure would be worth many laughs.
Just another reason to not take the Russian dictator's threats seriously. Granted, any nuclear accident anywhere in the world is a global problem, but I seriously doubt there is enough confidence in the weaponry to hit the launch button.
Accidental nuclear explosions aren't a thing. Making a nuclear explosion is really, really difficult; Ask Oppenheimer.
And a single nuclear bomb explosion isn't a worldwide problem. We've already had 530 nuclear explosions above ground worldwide (almost half of those in the USA); And three times as many again have been exploded underground.
One more could be a seriously bad day for people nearby (say, within a hundred km or so), but it wouldn't hurt anyone who wasn't.
Even a correctly constructed nuclear warhead can only cause a nuclear explosion if it's correctly triggered by its own detonation mechanism, and if it's damaged in any way, it simply won't work.
You could get an accidental conventional explosion from the thing, but that's true of pretty much all conventional explosive ordnance.