> To keep a military base in a country you either need to be allowed to do so, or you have to do so by force, by occupying the country.
There are all sorts of levers US, China, Russia can pull to in order to put pressure on a country for such things. There's occupation, mutual benefits, long standing agreements post wars, soft power, sanctions, etc. Geopolitics is complicated.
And this is all is part of what "allowing" means. If a country is unwilling to allow for it, the only thing is left is either accepting is as a reality or trying to do so by force.