Yes, electronics are
often washed...in
ultrapure water. Very briefly, and then immediately dried.
LCDs are definitely not sealed enough, many capacitors are electrolytic, and fiberglass is not impermeable to water (in fact, water-logged fiberglass is an issue for boats in areas where weather causes freeze-thaw cycles.)
Your dishwasher is full of mineral deposits, food waste particles, and likely quite a bit of mold. Getting rid of all of that would involve dissolving deposits with vinegar or citric acid, then running some lye or similarly aggressive treatment to get the mold and organic waste out. That's a lot of hassle.
You can't put "soap" in a dishwasher unless you want a giant bubble factory. So now you're looking at trying to find a specialty cleaner.
Most people's water is not nearly pure enough for the keyboard to not have issues afterward. You MIGHT get away with it if you thoroughly blasted it with compressed air and then dunked it in distilled water.
That's a huge amount of hassle.
Unless something has been spilled on the keyboard, just periodically brush out debris and then hit it with compressed air...