Destroying a nuclear sub, or a nuclear weapon, doesn’t lead to a nuclear explosion. It takes considerable care to cause a nuclear explosion, and smashing a reactor or warhead just leaves you with a pile of radioactive scrap.
Not saying that isn’t a problem, but it’s way less of a problem than a nuclear explosion