Sims 2 and Sims 3 are entirely separate, I have both installed with lots of Expansions on my laptop. You might notice it slow down, but that is normal when you install a lot of games.
As for the subject - some cheats exist in both, such as motherlode and kaching, but others have slight differences, like testingcheatsenabled true and boolprop testingcheatsenabled true.