Yes. Using cheat codes in a single-player game, or a device like an Action Replay, breaks no law. You own your copy and you are free to play it however you like.
The one exception is a paid competition. If entering requires you to sign a document agreeing not to cheat, then cheating is a breach of contract rather than a criminal matter, and the usual consequence is disqualification.