Elon Musk, the billionaire founder and CEO of the private spaceflight company SpaceX, wants to help establish a Mars colony of up to 80,000 people by ferrying explorers to the Red Planet for perhaps $500,000 a trip.
(...) we've put all our eggs in one basket. If we were on many worlds and were to mess up down here, there's a way for the human species to continue. I don't for a moment propose that the Earth is a disposable planet, and we have to put enormous efforts into making sure we don't muss up down here. But there is a chance.
It the war killed everybody, including those who have moved to the hypothetical Mars-style colonies (on Earth), then yes. That would have to be a pretty intensive war, though.
It is much easier for the nuclear war on Earth to accidentally kill essentially everyone even as Mars is left alone (simply because no attacks occur on Mars at all). But I agree that this isn't a very likely scenario.