Variable access is restricted within the template only. Accessible within the template itself.
Access the variable in any template of that module. Variable is accessible in all the templates of that module.
Initialize the variable and access anywhere wherever you need it. Within template or any other module or set it in the module and access in another service. Everywhere it is accessible.
Access a value from one module to any other, use the env scope and access the value.