Diodes when used for protection are most useful if used as clamp circuits.
But you do need a in-line resistor in series with the input or output.
The diodes then are wired from the signal line (on the internal circuit side of the resistor). One to the relevant positive supply rail. The other to the relevant negative or 0V or ground supply rail.
The diodes should be wired so that they are normally reversed biased. Fast response diodes are recommended (1N400x or other diodes intended for mains rectification are too slow for semiconductor production), and they should be rated so that they can handle the maximum expected over voltage and the current that flows at this over voltage. For circuits where the in-line resistor can be a fairly high and the protection voltage is not too high, signal diodes like 1N4148 can sometimes be used.
Protection of DC supply inputs from over voltage is far more tricky. The best protection is by using different plugs and sockets for different voltages. But for existing equipment this is of course difficult or not practical...
And most people who do electronic tinkering at some stage have killed something! At work, we used to be responsible for some telecommunications equipment. It came in both 12V DC and 50V DC versions, with the only difference being the part number. Both used the same DIN connector. Guess who connected a 12V unit to a 50V system....!
Inside it used 4000 series logic chips. One was blown apart, and none of the rest worked. I had to replace all of them.
Mark