There is even such premium DD Paolo that has crawling smoke and a high speed but bad concealment, that Dd is the best to do such kamikaze torping.
But other more versatile Dds do that technique as well.
Let's say you are in a loosing 2 vs 3 situation at the end of the battle, then the only way to turn it to 2vs2 and hopefullly win is to knock out one primitive ship with such kamikaze torping. Also if the enemy has hydro you surely miss all long range torps, so the kamikaze way would be your only chance then to turn the batle to victory.
It requires not to be afraid of, no illusional safe play, it is an agressive rational method.
Most times you jsut try to use rocks for that, soemtimes you set smoke as an artificial rock, sometimes you can just in open waters swim straight towards the enemy.
The idea is clear, your goal is to knock out 1 ship and hopefully survive.
Any torpedo boat, for exampel a cruiser, can try to do the same of course.