Are you developing your own validation hook script for use with certbot --manual? That's the only case where CERTBOT_DOMAIN is set.
If you're wondering where in the Certbot code it's set, it's at
although we were just saying in another forum thread that you shouldn't need to look at things in _internal in order to develop code to work with Certbot.
Certbot sets these variables in the process running the hook script, when actually performing an authentication. That means that you'll never see them on the command line or anything.
The explanation of how these are meant to be used appears in the Certbot documentation at
If you found that unclear for what you're trying to do, maybe you could give us some more context and we can try to help you understand how to do what you want.