Almost certainly not. Age ratings like the ESRB's T for Teen are recommendations, not legal restrictions on play.
What the law does restrict is sale. A retailer can't sell a 17+ game to a minor, but a parent letting their child play one at home is a different matter entirely.
Legal versus advisable are separate questions, though. Teen-rated games commonly contain violence, strong language and drug references, and a toddler has no framework for any of it. The rating exists precisely because someone thought about that.
So: not illegal, but the age guidance is worth taking seriously.