You could use uid and gid with the user: element. Both don’t have to exist on the host or inside the container.
I am not sure if most containers run as root, but sadly a lot do. Every image that uses s6-overlay does (e.g. Linuxserver images).
That’s why I prefer to use Bitnami images, as they always run as unprivileged user.
They are still not perfect, especially if your companies compliance policy requires you to run containers with read-only container filesystem.