Some thermos flasks could be cleaned in a dishwasher, however not all are dishwasher-safe. That is disclosed by the producer of the thermos.
If it’s not dishwasher-safe, be sure you take the thermos aside utterly and handwash after each use. Don’t neglect to take away the rubber seal throughout the lid to make sure that no meals or liquid is trapped beneath.