Toilet Brushes can be washed in a dishwasher.
However it's not a good idea to wash a toilet brush in a dishwasher because it can cause contamination from the toilet to the dishwasher.
Although the dishwasher should get rid of bacteria on the toilet brush and in the dishwasher there's still a slight risk of contamination and I would not risk my own health or my families health by washing a toilet brush in the dishwasher.
The way I wash my toilet brush is to fill a bucket with some hot water and then add a cup of bleach to the bucket of hot water.
Then after using the toilet brush I rinse it off in the bathtub with hot water and then place the toilet brush in the bucket of hot water and bleach.
I then allow the toilet brush to sit in the bleach and water for 30 minutes to an hour.
The bleach kills germs and disinfects the toilet brush and then I just rinse the bleach off the toilet brush and empty the bleach and water into the toilet and place the toilet brush back into that bucket after it's empty.