Is there any program I can use to repair this SD card?
Technically the card does not need to be formatted before you burn a Pi OS image to it, since that will overwrite any previous formatting anyway. As I understand it, the reason you need to format it first on MS Windows is because some of the tools used there to burn the image won't do anything with the card until it is formatted.
However, if you use a low level tool such
dd, available on linux and other POSIX systems (including I think macOS, and apparently on Windows via MinGW), it does not care about the current state of the card.
dd to burn an OS image to an SD card
If there's something seriously wrong with the card this will probably fail with an error,1 but there are no actual integrity checks, so you may want to compare the card to the original image afterward with a tool like
diff.2 If not just pop it in the Pi and see.
If that happens the card is truly defunct and cannot be fixed.
There are perhaps more efficient ways to do this, point being the first N bytes read from the SD card's device node (whatever you used as
dd) should be identical to the first N bytes from the image file (whatever you used as