Agreed, if an extinction level event happened on Earth, we'd be better off riding it out underground, than moving off planet.
Most plausibility the long duration space flight should prevent the common cold from making the trip which would also prevent many hypothetical super plagues from doing so as well. In theory you could do the same on earth, but it’s unlikely for a self sustaining underground colony to consistently maintain that level of quarantine for new arrivals.
However getting a self sustaining population on Mars that could survive indefinitely is currently just science fiction and making the trip is the least difficult hurdle for changing this.