First, several IT certification including the one that would apply to this situation. When you spill something on a keyboard like coffee or soda you can wash it in the shower then let it dry completely. Completely is the operative word here. This also applies to if you drop an electronic device in salt water or the ocean you need to wash off the salt before it rusts. Again, you need to let it completely dry. If you try to run current through something that is still damp you are going to create a lot of problems. However, all this effort could fail as well.
Now the dishwater part. Keyboards are plastic with a circuit board inside them. Besides a few extra components you don't want being wet that is the main thing you have to protect. Basically if you throw a lot of hot water and heat (drying mode) of a dishwasher you are probably going to damage something. Although, in theory is possible for it work, but I would strongly recommend against this. Keyboard aren't designed to this, if they were it would say on the box.
In other words, don't do it.