Most exhaust fans do eliminate odors from your bathroom. Interestingly, for many people, that’s the primary purpose of a bathroom fan. It helps get rid of the smell after you use the toilet. That said, not all exhaust fans are quite efficient at removing odors.
Their basic job is to exchange the inside air with more of the outside air. This exit of air takes with it all the foul smells hanging in the bathroom. As fresh air enters, the bathroom does not smell as bad as it was smelling some moments ago.
If odor elimination is a priority for you, then go for bathroom ceiling fans that have a filter, preferably a carbon filter. Carbon filters are the best at absorbing odors, so they actively remove bad smells as well as smoke.
This is the reason why many air purifiers feature activated carbon filters. In addition to removing dust and allergens, these purifiers also kill mood-killing smells from a room. A bath fan with an odor filter has the same function.