Run a build tool or a converter in a container with a bind mount, and the files it writes are owned by root on your host. Then you need sudo to delete your own output. Running the container as your own user avoids that.
docker run --rm --user "$(id -u):$(id -g)" \
-v "$PWD:/work" -w /work \
alpine sh -c 'echo hi > out.txt'
id -u and id -g print your numeric user and group, so the process in the container runs with the same numbers and out.txt belongs to you. The user does not need to exist inside the image; Docker accepts any numeric ID.
This is handy for one-off tools: a static site build, an image converter, a linter. For long running apps, many images have their own PUID and PGID variables that do the same thing at startup, and I would use those when they exist.
A user that is not in the image’s /etc/passwd has no home folder and no name, so tools that want to write to $HOME or look up their user may fail. Setting -e HOME=/tmp often helps. And an image built to run as root may need to write to paths your ID cannot touch, which shows up as permission errors inside the container.
Further reading: docker container run: user, Running containers: USER