China can reasonably invade maybe 20-30 (50? 100?) countries,
No, it cannot. It's got a massive army, but it has a VERY hard time moving that army anywhere. An example of how hard a time was on display recently when they found themselves with very few helicopters for disaster relief. The old saying that amateurs talk tactics and professionals talk logistics holds rather dramatically here: you are apparently clueless about China's logistical limitations.
Yes, (laugh), because China and Brazil do not have an army which can land an attack in a range of 1000km.-2000km. from their borders.
And how, pray tell, would they do that? How do they move those forces? How do they keep them supplied with food, ammunition, and fuel?
Over land? It doesn't have that many neighbors, and a good many of them (like Afghanistan) are too sparsely connected over VERY rough terrain for the supply line needs they'd have. Check out google maps sometime, look at China's borders and you'll see what I mean. Two of them (India and Russia) are nuclear powers with sizeable conventional forces as well, and nobody has ever invaded a nuclear power. And a number of their neighbors are allies, which sort of makes invasion a non-starter. As for invading further countries overland by moving through their neighboring allies, what candidates are there? South Korea? Nope: they tried that before, they won't try again. Thailand? Maybe they could, but I think even the Chinese are tired of southeast asian military adventurism after the mess in Vietnam and Cambodia.
What about invasion via the sea? Well, China doesn't have that kind of sea lift capacity. The capacity they DO have is focussed on Taiwan, which is only 100 miles away, and for that they don't have enough yet (though they're building more). They sure as hell can't send and supply a force anywhere in Africa by boat.
Over air? They've got almost no airlift capacity.