Are Cheats Illegal to Use in Games?

In single-player, no. Once you have bought a game, how you play it is entirely your decision.

Online is a different matter. Where the only cheats available are trainers or hacks, using them breaks the rules of essentially every major service, and games such as MapleStory, Xbox Live, PlayStation Network, RuneScape and World of Warcraft all ban for it. Features the developer built in deliberately, such as hints or hidden tricks, are fair game.

Flash games follow the same logic. Built-in cheats are fine, and so are cheats in a free game, but hacking a title you paid for is not something to risk.