No. Actions performed inside a video game are not regulated by law. A developer can put whatever in-game content they choose into a title, and a player doing something within the game's own rules is not committing an offence.
Desecrating an actual physical flag is a different matter, and in the United States the Supreme Court has held that flag burning as protest is protected expression. That is a real-world question with real case law behind it, and it has no bearing on simulated behaviour.
What can happen in practice is that a game declines to include such content, or that a platform's content policy restricts it. Those are commercial decisions, not legal ones, and a player might get a ban from a specific title without anything illegal having occurred.