It's definitely a thing you don't do without good reason (enemy boarding action/mutiny) but remember subs are designed to survive nearby explosions underwater; there's redundancy and there's massive amounts of time spent training damage control where your repair or work around damaged systems.