I’m talking about environment variables, not about variables usable only in sway config.
For example, looking at https://github.com/EndeavourOS-Community-Editions/sway/blob/main/.config/environment.d/30-envvars.conf
MOZ_ENABLE_WAYLAND=1
Is not set if you open a terminal in sway. So it won’t be picked by other programs either. That’s just an example. To be clear, Firefox doesn’t need that anymore as it starts in Wayland by default.