Of course, if there are only a few ships, but is it worthwhile then?
Nuclear bombers against war ships are not an ideal choice.
Ships generally have a high air defense, therefore from a certain fleet size the bomber will be shot down before he can put his bomb.
If the AA is about 25 to 30 (X-factor) or higher, a single atom bomber do not live long enough to drop the bomb..
Incidentally all nuclear weapons and also rockets cause no harm against submarines.
