Ah yep, I should've clarified that I meant Germans
It's certainly possible to make those kinds of attacks! Likewise, it's possible to make your attack plots by radar, and for example US submarines in the pacific actually used that as well. If you're interested in that, the TMO mod for SH4 even supports radar (and sonar) info being fed directly into the TDC on American subs.
And although not designed for submerged attack, I've consistently read in reports that captured German hydrophone equipment was considered sophisticated and of very high quality by the Allies. (Although this is also true of German optics, so perhaps it's no surprise the Germans relied on periscopes for accuracy first and foremost).