There are no cheat codes to unlock The Rock in WWE 12.
Use Create-A-Superstar to recreate The Rock's appearance, moveset, and entrance. It's the intended way to "play as him" if not on the base roster.