The GoG releases of DOS games are bundled with either Dosbox, or ScummVM.
Ultima Underworld runs in a Dosbox environment. Here’s what you need to do “extract” it from there:
– Open the file game.gog with 7zip. It’s a renamed .iso, which in turn is similar to a zip file
– copy the folder “UW” to the DOS games directory on your phone
– launch Magic Dosbox, and create a new game profile
– set “uw.exe” as main program, and “uwsound.exe” as setup file.
– save profike
– enter profile settings again, and tap “Setup” in the lower left corner. Comfigure sound with these settings: adress 220, irq 7, dma 1
– save, quit, then launch the game