Remove Escape on TouchBar in Safari The question "How to disable Escape key in Safari" was asked here a few times. Now since on the new MacBook Pros the Escape key is a touchscreen button, it is much easier to press it accidentally, but there is a good chance we can actually remove it in Safari once and for all.

How to remove  Escape button from TouchBar in Safari? (or any specific app)

There is no such option in Customize Touch Bar... menu:
You can use Karabiner-Elements [1, 2] to map escape key to some other functions with visual feedback (e.g. mute). The feedback helps to remind you that the key is not longer mapped to escape. 

You can then map a less useful key to escape. For e.g. on a US keyboard, the section (§/±) key is on the top-left corner where escape key could have been.


Install and run Karabiner-Elements.
In Simple Modifications, choose No product name (No manufacturer name) as Target. That's the touchbar. Then add item, from escape to mute.

To map section (§/±) key to escape, choose Apple Internal Keyboard. Add item, from non_us_backslash to escape.



Source