Well ES & Pegasus are just a frontends so once you quit an emulator you fall back to them. Retroarch is a frontend and a framework for all libretro cores. If you map the exit button input_exit_emulator = "ralt" to a free button on your keyboard / joystick / gamepad / whatever RA will instantly quit and either return to ES / P-FE or to kodi if you've started RA directly.
Controllers like the Sony PlayStation3 DualShock3 can utilize the "PS" button sony-playstation3-dualshock3-controller-usb.cfg#l29 to open the menu for example.
My "special" key on my gamepad opens the RA menu and if I want to stop it I'll return to ES. Anyway it's not possible to deal with all emulators without a keyboard so I've also a Rii Mini i8+ in reach.
Just to follow-up and close the loop, I used your suggestion and mapped the exit key to a free button on the gamepad and it worked. I ended up going with the 8bitdo SF30 Pro you recommended and it's indeed nice.
So in the end, the confusion is that ES offers a hotkey but that really doesn't do anything in the game. You need to rely on the RA settings for exit options. I now have start+select go into RA and star exits RA (back to ES for me).
Thanks again!