Yes. Submarines that are not under threat from an enemy destroyer can use their special ability to choose to make a surprise strike (either on attack or defense) or choose to submerge. This occurs before any dice are rolled by either side. Typically, the defending sub would choose to submerge, as it defends on a 1.