What they're referring to is more specific than environment variables in general: you can use the ENV command in a Dockerfile to bake in a secret at build time, and that's what you generally shouldn't do.
Injecting environment variables at runtime, however (through docker run -e or whatever orchestration system you're using), is good.