Repairing stripped threads on a nut type bottom bracket
The thread repair tool that is used in this sort of situation is called a die. The common size for crank nuts is M8x1.25.



However, too much material appears to be lost here for that approach to be reasonable. Crank nuts/bolts are one of the higher torque items on a bike, meaning you don't really have much leeway for severely damaged threads. Also, hardened steel threaded parts like this don't take as well to thread reformation as softer steel parts. Taps and dies have some capacity to shove material on damaged threads back into place, but here it's likely to break off instead.

You don't indicate whether you have a cartridge or cup and cone BB, but nutted BB spindles are almost always (maybe literally always?) found on cup and cone BBs. If so there's nothing stopping you from just replacing the spindle; basic cup and cone BBs generally let you do that freely since they tend to all use JIS spindles. You need the same length and, if applicable, offset. Pull the existing one and hopefully you'll find a code on it like the one in the picture. Match the new one with that. Shops don't tend to just have them anymore, since the common approach is now to just replace everything with cartridge, but they are still able to be ordered, and are cheap.