I wish I had done that but getting HR involved seemed like the nuclear option to me, especially for something the person may not have known about. I had approached the team manager but he, in spite of frequent rants about the evils of political correctness, didn't wish to act since he thought it was due to what he called 'culture'. Unpleasant business all around.
I loved the technology and product at that workplace but such awkward situations ensured that I moved on as quickly as I got the opportunity to do so.
I worked at a big corporation. It was against the rules to comment on body odor of a coworker because of an incident where the team got together to give someone perfume and soap and such and try to nicely tell her she smelled. Turned out she had a medical condition and it was not a hygiene issue and she was incredibly upset. HR sided with her.
Unless the person in question had a medical condition... I find this very hard to believe. There are a lot of cultures where people don't use deodorant but wash every day (and more if doing sports etc... And it's not an issue).
If a few people mention it, they will have to do something. And you don't have to risk getting yelled at.