How to go about creating location selector: a languages like "countries" global variable?
This is a typical use case for domain access:

https://www.drupal.org/project/domain

This module includes a domain switcher, which would be the selector widget you asked for. There is only a dev version for D8. This is a heavy weight module and until now I did avoid using it in D8 and did some custom coding for the functionality I need. To get some ideas I would investigate this module.