In ZTERM, the approach to that problem is via the "Safe" (i.e. Safe Disconnection) tab in the Configuration dialog. It doesn't allow you to disable the "X", but it does allow you to define a message box/prompt and optional password to warn/guard against an unsafe disconnection. The main limitation is that I don't think you can define it or disable via ESC sequence. But you can define a "safe string" (some message at a known position on the screen) that it will detect as an indication that the current screen is safe to disconnect from without warning. This works well if your main menu has some unique identifying string, not so well otherwise. But it is difficult to just turn the feature on, due to the need to get it set up on each PC (unless you work out some scheme to update the registry, which is where the information is stored, from the server without user intervention).
For comparison, in ATE, we don't have the "safe string" mechanism, but you can remove the "X" (via the -mx command line switch), and you can define/enable/disable a dialog and password to prevent disconnection at any time via the TAB(-10,AG_DISCONNECTPW) command.
However, none of these methods can stop the "three finger salute" or the reset button. Which is why ultimately you need to be able to detect disconnects and close down gracefully. (A-Shell normally does a pretty good automatic job of that under UNIX, but in some cases it may require you to detect error 250 and/or 251 and do something specific in order to tie up loose ends on some critical process.)