Can I create (for example) an Ubuntu virtual machine, plug in my USB stick and then install Ubuntu on the USB stick from the Ubuntu running in the virtual machine?
Yes you can make the bootable Ubuntu on USB from Ubuntu on Virtual Box.
In the VirtualBox menu select your flash drive from the USB devices, now the virtual Ubuntu detects and mounts the USB flash drive. Now go to System → Administration → Startup Disk Creator.
Installing onto the USB
I think it can be done, I tried it.
Selected my 8 GB pendrive and configured it to EXt3/Journal file system where flash drive is usually fat32, ext filesystem is usually recommend by the Ubuntu site.
and click Install Now.
A half hour passed and the progress bar reached 60% but it was my bad. The power was gone and the system shut down.
I can't do the same and confirm the procedure for you but I hope my experience helps you. This is enough to say that it works.