As the top says, does the payload of an ICBM or regular airplane bomber (please excuse my ignorance) explode if the ICBM or bomber is shot down? So, say a defense laser in space (yes, I know; this is hypothetical for a setting, but) disables an ICBM in mid-flight, would the bomb detonate as well? If I recall correctly, even regular bombs shouldn't explode if the bomber explodes, that is, the bombs are meant to go off exactly when the bombardiers wish them to go off. Thanks.
Usually it won't set off the payload.
The payload is designed in a way to prevent it from going off prematurely - say it needs to be armed before it can go boom. Usually you would only arm the trigger mechanism in the end phase - directly before payload delivery since you want to hit your target and not your own installations.
Modern explosives are remarkably unwilling to go off without the correct primer. Some of them will not explode even when set on fire (and just burn in that case). However some others might go off if they just get heated enough.
For nuclear weapons, it's even more difficult to determine. If the conventional explosives go off in an unpredicted pattern, you might have a conventional explosion but not a nuclear. If these explosives do not go off in the right pattern, the bomb might never reach criticality and fission (and possibly fusion) stage of the weapon will never trigger. In any case, wherever it went of, the bomb might scatter plutonium, uranium and other radioactive material where it was shot down.
That said, an aircraft or missile crashing can cause ordnance to arm and there was at least one case where a US bomber with live nukes crashed, the bombs partially got armed on crash but didn't trigger in the end. https://en.wikipedia.org/wiki/1961_Goldsboro_B-52_crash
Nuclear/atomic bombs and warheads both have elaborate automatic arming mechanisms built into them that have to detect the correct sequence of (for example) acceleration, ambient pressure reduction, free fall, re-entry heat, and g-force in order to enable the firing mechanism for the warhead. If any of these signals is missing or presents itself in the wrong order, the arming mechanism is defeated and the device is not supposed to explode.