Environment Modules is usually deployed on shared host systems, but you can test behavior in containers.
docker run --rm -it ubuntu:24.04 bash -lc "apt-get update && apt-get install -y environment-modules && source /etc/profile.d/modules.sh && module --version"