It's a bit of a grey area.
- If a character in a book uses a real-world product, that's just the author trying to make his world seem real, and to relate to the reader.
- If a person on TV uses a product, the TV station will usually blur out the branding, so that they're not accused of trying to create a false association.
- If a person in a film uses a real product, you can be sure that a lot of money changed hands in an advertising deal
These are all basically the same situation, but the precedents set in each medium are different...
In shooter games, many companies in the past have been threatened with IP infringement lawsuits for including real guns, tanks, helicopters (names and forms that are trademarked and under copyright), which has caused many games to use fake names for their guns.
However, recently EA notoriously decided to stop bowing to these threats, and they have started using real names and looks in their shooter games again (without paying the licensing fees). This is a dangerous game -- the product owners may sue them at any time. They might win the lawsuit, because they're just "depicting real products in real settings", or they might lose, and be forced to pay licensing fees to acquire the rights to use this IP...
If I was making an indie shooter game set in the real world, I'd probably just shoulder that risk and use real products for the sake of authenticity... and because I think the lawsuits are BS... but it is a risk.