How do I create a Twig override for server 500 error? How do I override the template used for a 500 error?
Is there any way to achieve this from a module?
This cannot be done in Drupal as a 500 error is a server error. Drupal will never be reached.

However, if you can configure the server, you can accomplish this yourself. This may also work from the .htaccess level in Drupal. I suggest trying it at the server level first if you can.

If you are running Apache, you can use custom ErrorDocument directives.

If you are running Nginx, see How To Configure Nginx to Use Custom Error Pages on Ubuntu 14.04.