I was wondering if using trademarked items such as a bottle of "Pepsi", or a video game like "League of Legends" can make you vulnerable to lawsuits. I think so, but I am not sure, because I see a lot of media where products are often renamed into something similar like "Google" to "Poodle" and so on.
What you're talking about here is trademark law. "Pepsi", "League of Legends", etc, are trademarks. It's completely legal to refer to someone else's trademark, as long as you use it properly. But there are two big catches.
Number 1: You can't use someone else's trademark as your own. You can say, "George liked to play League of Legends". But you can't make up your own game and call it "League of Legends".
Number 2: You can't use a trademark as a generic term. For example, Coca Cola company's lawyers used to go after anyone who used the word "coke" with a small "c" as a generic word for "cola". They had a good legal reason to do this: The courts have ruled that if a company does not vigorously defend their trademarks from generic use, that they can lose their exclusive legal rights to the name. "Escalator" used to be a trademark, but the company failed to protect it, and the courts ruled that it was now a generic term for a moving staircase, not the property of any one company.
Number 3: If you refer to a trademark, you are clearly identifying who you are talking about. And if you say anything negative about them, they could sue you for libel. If you just wrote, say, "George Googled the word 'aardvark' and quickly found the information he needed", I can't imagine that Google would object. They're probably happy when lots of people talk about their company in a generic or positive way. But if you write a story about companies invading people's privacy by collecting personal information, and the chief villain in your story is an evil company named "Google", you might be hearing from Google's lawyers.
(Those are the issues I can think of, anyway. They're might be others.)
Unless you really need to refer to a real trademark for your story to make sense, it just avoids trouble to use made-up trademarks.
Like if you're making a TV show and the hero looks something up on the Internet, maybe in real life he's use Google, but it's easy enough to have the computer screen on the TV show say "Frugle". The audience will still understand what's happening and you avoid any potential problem.
In your case, if you want to say that the characters play a video game, does it HAVE to be "League of Legends"? Would it hurt the story if you said that they like to play "Hall of Heroes" or some such made-up name instead? If for your story to make sense the reader has to know some crucial fact about League of Legends, well I think that's just a bad idea. What if a reader has never played the game? I don't know what percentage of the world's population has played this particular game, but I'm guessing it's fairly small. (Personally I've never heard of it before reading this post.) So to make the story work you'd have to explain anything about this game that is relevant to the story. At which point you could use a made up game and explain the same things just as well.
Of course I don't know what you have in mind to write. It may be that there's some very good reason for naming this specific game.
2The reason you will frequently see the BBC, in particular, not use "real" trademarks in its TV shows is because it violates their editorial policies, and not necessarily because of actual legal issues. Other TV studios use product placement freely and even get paid for doing it.– KevinMar 1, 2019 at 18:29
@Kevin If someone is paying you for product placement, presumably you have talked to them and they agree to your use of their name. They're not going to sue you. (Well, unless you violate the terms of the agreement.)– JayMar 1, 2019 at 20:17
@Kevin A lot of times a TV show or movie will not use real brand or product names is because they want to be paid for product placement. They don't want to give it away for free.– CynMar 2, 2019 at 20:58
I can see the desire to use real names like "League of Legends" if you want to give the reader a feeling of being grounded in reality that just isn't the same if you make up a name - also, it's just a style that some people like to use. Stephen King comes to mind - he often uses real names, such as real car brands / models.– komodospJul 9, 2019 at 14:29
@colmde Sure, using real brand names that the reader is familiar with can give a certain feeling of reality to the story. Like saying the hero drank a Coke or drove a Ford. But I'd be careful about assuming the reader is familiar with any but the best known brands. "All my friends play League of Legends" is not at all the same as "Anyone who might read my book plays League of Legends". My father wrote a book where he made a reference to a certain store and apparently expected his readers to be familiar with it. I'd never heard of it. ...– JayJul 9, 2019 at 15:11