Here are two main ways a debugger can pass an environment variable to the debuggee.
1. Set the var in the debugger process, and then let the debuggee inherit them when its created. This is easy, but dangerous. For example, you should probably restore the environment. Also, the environment block is process wide and so if you have multiple threads trying to set and restore, it's possible that your debuggee spawned from Thread A may inherit vars set on thread B.
2. Pass via environment block parameter in CreateProcess. I think this is the officially correct answer, but it is more complicated. You have to build the env block yourself. And if you want the debuggee to inherit the other debugger vars, you'll have to merge them in.

For managed-debugging, the CLR exposes several knobs that can be controlled by environment variables. So this can be a way for a managed debugger to control some things about the debuggee. (such as disabling the pinvoke MDA that slows things down by 100x) .