It's possible, though it's (probably... see below) prohibited by both the Outer Space Treaty and the Partial Test Ban Treaty of 1963. All countries known to possess nuclear weapons capability, with the exception of North Korea, have ratified at least one of these (North Korea has signed, but not ratified, the Outer Space Treaty).
Whether or not a non-weapon nuclear explosion (for example: using a nuclear device as a sort of improved dynamite for, say, mining purposes) would violate the Outer Space Treaty is an interesting legal question, since the treaty expressly refers to nuclear weapons and goes on to say that the use of any equipment or facility necessary for peaceful exploration shall not be prohibited. This could potentially eventually become important.
Chat with our AI personalities
Yes, it is possible to detonate a nuclear weapon in space. The explosion would produce a large amount of energy and radiation, but without the effects of an atmosphere to contain the explosion, the impact would be more limited compared to a detonation on Earth.
The Challenger Space Shuttle blew up on January 28, 1986.
11 am 74 seconds into flight
The space shuttle Challenger exploded on January 28, 1986, shortly after liftoff.
The space shuttle Columbia disintegrated upon re-entry on February 1, 2003.
The space shuttle Atlantis did not blow up. It successfully completed its final mission, STS-135, in July 2011 and is now retired. The space shuttle Challenger exploded in 1986, and the space shuttle Columbia disintegrated during re-entry in 2003.