So I was browsing on Tv Tropes (don't judge me) and found out this trope called A.K.A.-47 which authors or creators use to avoid getting lawsuit from companies. They change the names or tweak some designs of the product which allows them to have free use of it. But I remembered back then, the SCP community was facing a lawsuit against a Russian because one of the branches was called Russia and apparently they didn't ask permission to use that name. I'm really confused how lawsuits or copyright works so can someone please help me better understand this stuff/
Sometimes shows do this not because "if we mention Pepsi, they'll sue us" but because "if we mention Pepsi, Coke might stop advertising on this show" (or might not start.) This is especially common when a show might get syndicated to a lot of markets separated in time or space from the current one. (On one US soap opera, the children used to be sent off stage "to play Pretendo", which everyone knew meant Nintendo.) In shows where there is "product placement" (very common on reality and competition shows, for example) San Pellegrino pays big money for us to see the players drinking their drink. Any time some other drink appears, the brand is concealed, mostly to increase the value to San Pellegrino of the placement they've paid for.
Understand, this is not about Pepsi being a copyrighted word, or the shape of a bottle being a trade secret that can't be revealed on a sitcom, or any rules that a person has to be careful not to break, but are at least written somewhere. It is about comporting yourself in a way that maximizes ad revenue for your show. This is in many ways a more powerful motivator than laws and rules.
I am not a lawyer; but this is my understanding:
The point here is if the company (or person) can convince a jury that you intended your fake product to be their product, that the majority of people in in your audience would know this was their product, then you can be liable.
That is why you often see, for fictional tech billionaires, somebody will describe them as vunderkind competitors of Facebook, or Microsoft, or Intel. They name the companies as innoculation against copyright or defamation; the criminal CEO of a new startup social media company giving Facebook stiff competition cannot be Zuckerberg, obviously.
You can do the same thing with some products. Your character buys an electric car, and is happy to tell their buddy "This is a brand new company, but better than Tesla,Lexus, anybody."
It is fair use to use the name a real company saying they did NOT make your product. So if you need a fictional product that in real life is only made by Nabisco, you just invent a fictional company and fictional product name and actually name Nabisco and their product as the biggest competitor.
Clearly, the product is not Nabisco's, and you don't end up claiming their product causes something negative.
Now, if you are referencing some real-life public scandal in Nabisco, that might be enough for Nabisco lawyers to convince a jury that despite your attempts at concealment, you can only be talking about them.
Don't try to use fiction as a clever way to avoid lawsuits; it is unlikely to work. These are laws of "intent", technicalities will not work. Actual humans, in jury, have to decide whether you intended to defame a person or company, or intended to violate their trademark or copyright. They will see through your defense of spelling it "Mabisco", or naming some criminal "Jim Smythe" instead of an actual "John Smith".
If you are content with using a similar product that might be a competitor of an existing product or company, you can probably do that by actually naming the real-life product and company as competitors in your fictional world.