The remote I just bought is not an IR remote. Instead it works with 2.4G and is recognized as a keyboard.
In that case the Remote Control section of MC doesn't apply to you, particularly as it is recognised as keyboard. The MC functionality works with IR Remotes, and the learning function is for learning IR codes.
If you did have an IR Remote and wanted to assign the Backspace key to the ESC IR Code, then you would select the "Back" function in the Remote Control Commands dialogue, start the learning process, and then press the ESC key on the IR Remote while pointing it at the IR Receiver. That should work, but I haven't tried. There is nothing special about the ESC IR Code. It won't actually do anything on the PC until it is translated into a command.
Regarding the accidental closing of Theatre View, the obvious answer is don't press ESC twice. But no doubt that can happen, and if it does, I gave you a couple of fast ways to get back into Theatre View. Of course, maybe your 2.4G wireless remote doesn't have the equivalent of the Green/Media Center Button. If it is emulating an MCE remote it should.
I tried entering the line:
<Entry Key="Escape" Command="27000" Param="27" TranslateFlags="2" />
Into the Resouce.xml file to see if that stopped MC responding to ESC in Theatre View. Alas, it did not. The Resouce.xml converts keystrokes into commands, but the 27000,27 MCC Command generates an ESC, so doing that is a bit circular, and the Resouce.xml line doesn't stop the ESC keystroke from being received by MC, it just generates the internal command that generates an ESC key press. Some keystrokes are processed by MC regardless.
So, I don't think you can stop MC Theatre View from closing if ESC is pressed twice.