The person who told you this may have sincerely believed it, but its not true. Fair use allows you to photograph anything in a public space (people, objects , buildings, whatever).
What’s a public space? Anyplace that is open to the public: sidewalks, parks, government buildings, malls (yes, malls), etc.
Let’s say that you were taking a photo of 3 people laughing while eating around a small table. The background has other people in it , but the depth of field of the pic makes everyone but the 3 really out of focus. And, for arguments sake, it’s outdoors in a public park. In the pic, turned away from the camera is a can of Coke. You can’t read the name , or see the Ribbon Device (yep, that’s the legal name for the Coke ribbon). The pic turns out great and you want to sell it through a stock photography company. You get permission from the models (even though there is a legal argument that you don’t need it cuz it was a public space - but that’s a whole different discussion !).
Are you legally allowed to sell the photo without Coke’s approval? Yes (cuz it’s incidental to the image and not showing anything trademarked or copyrighted). But, and it’s a huge but, if Coke sues you it doesn’t matter that you’re right… you can’t afford to fight a company with pockets that deep. So you’ll stop selling it, not because you’ve done anything wrong, but because you can’t afford to fight.