A lot of the secret codes are either carrier specific or ROM specific. An example, I bought my son an HTC EVO 4G (from swappa) and called sprint to activate it. They had me enter one of the secret codes and it should have launched a window that would ask for a PIN. But it did not.
The reason was because the phone that I bought was running CM7. In order to activate I had to enter this code. But in order to enter the code, I had to have the Stock HTC Sense ROM installed on the device.
I found a flashable version of the Sense ROM, flashed it, called back Sprint and entered the Secret Code. Everything worked as expected. Then after the device was registered with Sprint I flashed CM7 back on the device.