No. Cheat codes are exclusive to the PC and Mac versions of The Sims 2. The PlayStation 2 (and GameCube/Xbox) console ports do not support the testingcheatsenabled console command or the standard cheat entry method.
Console versions feature a different "Story Mode" with unlockable rewards instead of open-ended cheat access. If you want full cheat functionality (money, build mode cheats, spawn objects), you must play the PC/Mac version.