To reset the Esc key on a Touch Bar-equipped MacBook Pro, do the following:
Open System Preferences.
Click on Keyboard.
Click on the Keyboard tab at the top if not already in that view.
Click the Modifier Keys button.
Select the Caps Lock, Control, Option or Command key to act as the Escape key.
Click OK.