The black carbon deposits are a sign of arcing (sparks). Both your cord and the inlet are beyond repair and should be replaced. Replacing one won't work, the other one will quickly ruin the new one.
How to prevent it? To start with, always, without fail, turn off the breaker on the dock pedestal before connecting or disconnecting the cord. If there's no breaker on the dock pedestal, turn off the main breaker on your boat before connecting or disconnecting the cord. Unplugging the cord when electricity is flowing is sure to generate an arc and that causes what you see.
Sometimes we see this damage on the male end of the cord and that's caused by a faulty outlet on the dock pedestal. That's more difficult to deal with because it belongs to the marina. Use a different outlet or ask them to replace it.
Other things to do: Don't drop the ends of the cord in the water, especially salt water. Don't leave them out in the rain when not in use.
Applying a coat of dielectric grease to the pins and sockets is a good maintenance procedure as it will shield the contacts from corrosion but still allow electrical contact. Dielectric grease is an insulator but the action of plugging in the plug wipes the grease from the actual contact surfaces.
Screwing on the ring helps hold the plug steady so it doesn't wiggle and loosen. Strapping the cord to the boat a foot or two from the plug also helps to remove strain and movement.
In the end, you should plan on replacing these things every several years.
I've never seen a surge protector on a boat or one in a catalog intended for a boat. I wouldn't worry about it.