It depends on whether or not the defending subs get a Surprise Strike. If the do, they will still fire if they’re hit by the attacker’s Surprise Strike. If they don’t, they’ll be removed before they can fire.
This is a change from Revised. In Revised, subs always fired at the same point in the combat sequence. The difference the presence of enemy destroyers made was when the casualties were removed. In Anniversary, subs actually fire at different points in the combat sequence depending on whether or not there are enemy destroyers.