Is it legal to use trademarks in the game such as Intel and AMD?

I saw some games such as PC Building Simulator using Intel and AMD as their processor name in the game. But there are some similar mobile games that change it to INTOL or RMD for some reason.

May I ask is it legal to use trademarks in the game?

I’ll prefix this with I’m not a lawyer.

But no, it isn’t legal to use trademarks in your game without the permission of the trademark holder. Most brands are protective over their brands and trademarks and for good reason they have spent a lot of time and money building the brand image they want. They might not want to be associated to your game it might have content/themes that they do not want their brand associated with. Having their trademark in your game may give the impression that they endorse or support your project. Which can be misleading to consumers.