Some thermos flasks can be cleaned in a dishwasher, but not all are dishwasher-safe. This is disclosed by the manufacturer of the thermos.
If it’s not dishwasher-safe, be sure to take the thermos apart completely and handwash after every use. Don’t forget to remove the rubber seal within the lid to ensure that no food or liquid is trapped underneath.