Oooo! A tricky one! If it's someone I know, that I'm comfortable with, I'd tell them. If it was a co-worker, I'd say something to the supervisor (stinky people are not good for retail business or for a good office environment) and let them handle it. If it was the boss...and I couldn't go to a higher up, well, I think I'd have to slip them an anonymous note or speak to someone whom I know is close to them and see if they can gently bring it up. A lot of times the 'offender' cannot even smell their own odor so they are often times completely unaware of it. It's hard to bring it up without causing the person an extreme amount of embarrassment.
But, if someone forgot to zip their pants, or they have something hanging out of their nose, well, I tell them whether I know them or not. I would hope someone would do the same for me!!! If it's someone I don't know, and it's a nose issue, I hand them a tissue and say in a whisper, "wipe your nose honey".