Let's use our imagination. Suppose we had miniature sharks, perhaps 30 cm long, called Isistius. Suppose we imagined them with luminous bacteria-powered bellies so that they could not be seen from below, immensely sharp teeth that they used for attacking whales, scooping our mouthfuls of skin and blubber like cookie cutters, leaving circular scars. That might earn them the popular name of cookie cutter sharks among imaginary people who couldn't remember imaginary names like Isistius. Now, suppose that they confused subs with whales; they couldn't dig very far into the metal hulls, but they could cookie-cut circular scars into the neoprene covers of hydrophones.
That would count as attacking subs, surely!
And it wold be very hard to prove the existence of Isistius, because othey would tend to cookie-cut their way through nets and escape.
So, yes, biologically it would be possible. Beware the dreaded Isistius, the phantom cookie-cutter sharks!
Of course, if your sub is a plastic pleasure craft, a bolshie whale could give it a pretty hard time too.
Wonderful stuff, imagination...