You have to get the system booted up under DOS to start with. That's the hard part. If you have a working Windows 9x/ME system you can just format the flash drive as FAT16/32 and select to make the drive bootable. Copy the win98 folder from the Windows 98 setup CD on to the flash drive. Finding the DOS
format programs from a working Windows 9x install or Windows 98 boot floppy may be needed as the target drive will need to be partitioned and formatted prior to installing Windows. The flash drive should boot up like any other hard drive. Make sure the computer has 1GB of RAM or less else unpatched Windows may hang. Windows 97 (95 OSR2) and later versions support FAT32.
You can use an emulator like QEMU to boot from a floppy image of a Windows 9x boot disk and set the flash drive device to the 1st hard drive. Then just run
sys a: c: in DOS after partitioning and formatting the flash drive to make it bootable. Copy utilities like
format from the boot disk to the flash drive so you can format the target hard drive.
Now boot off the flash drive and run
fdisk. Now that C drive is created, reboot. Now format C:. Then run
setup.exe from the win98 folder. Windows 98 doesn't need any drivers so it should work on any computer, but you'll be stuck with VGA 16 color graphics. USB legacy support will be needed in the BIOS if you have a USB keyboard or mouse. You can install Windows to the same flash drive that you just booted from. You can also use the hard drive in the computer in place of the flash drive. Just follow the same directions but make the hard drive bootable to DOS rather than the flash drive.
In any case once you have DOS installed it's a simple matter of running setup.exe from the win98 folder that was copied over. Even 32-bit Windows XP and earlier can be installed the same way from within DOS by running
winnt.exe /b from the i386 folder.