Yes, you can clean a plastic keyboard in the dishwasher but it’s not recommended. Doing so will void any warranties and may even damage or destroy your keyboard.
Remove any batteries from your keyboard and make sure you have an extra keyboard to use as it will take a week to dry. Put the keyboard on the top rack and set your dishwasher to rinse only with as cool of water as possible. Excessive heat may damage or destroy your keyboard.
Do not wash any other items with your keyboard.
After the keyboard is washed, tip it over to allow water to drain. Place it key side down on a towel to dry for the next week.