Variable in base path I need to change the BasePath in drupal 8 of all views and all node in such a way that it contains a variable (which will manage as country)
Like this:

site.locl/{lang}/{variable}
site.locl/en/testvar/node/100
site.locl/en/testvar/myview
Search for path inbound and outbound processing, that's what the alias and language prefix systems use for example. Both are tagged services, see PathProcessorAlias and the corresponding service definition path_processor_alis.

In Inbound, you cut off the part you want and store it somewhere in a service or so, where you can access it again where you need it. And in outbound, you add it again. As you seem to require both language and country, you will need to make sure the priorities are correct in relation to the language prefix handling.

Keep in mind that this will not give you any possibility to have different interface or content translations as there isn't really a way to store it. If you need that, you more likely need to use a language per language/country and figure out how to do fallbacks correctly.

There is also a module available that helps with this: https://www.drupal.org/project/purl. It apparently has an 8.x dev version, but I have no idea about the state of it.