Different airlines have different policies.

American Airlines is specific about the issue. It has a 'customer acceptance' policy that outlines numerous reasons for not accepting a passenger for travel on one of their flights. One of those reasons is listed on American's website: having "an offensive odor not caused by a disability or illness."

Unfortunately there are so many smelly people in this part of the world it would be very tough to enforce without it looking racist.