You can do so by defining a custom keyboard layout. This is quite convenient with Ukelele https://software.sil.org/ukelele/ : you can take any existing layout (e.g. the one that is currently active) and then change all key mappings, including which keys are dead keys etc. I used this to create a modified EN-US keymap where Alt-A/O/U produces the corresponding umlaut versions directly, and Alt-S produces German ß (so that when I have to write German text I can do so quickly and conveniently)