Absolutely—there are codes for Sonic the Hedgehog 2!
Classic cheat codes and level-select tricks have circulated among fans for years, so a quick search of retro gaming communities can point you toward working ones to enhance your playthrough.