No. Modifying or hacking a game almost always violates the end-user licence agreement you accepted when installing it, and in many jurisdictions circumventing technical protection measures is a separate legal offence.
Offline single-player modding with the developer's blessing is usually fine, and some studios actively support it. But cheats, memory editors and keygens used against online games can also get your account permanently banned.