Only a large country with enough spare capacity can do it, that's why both Iran and Kazakhstan were caught off guard by a few tens of thousands of miners settling down,
I don't know about Kazakhstan but Iran's short lived electricity problems had absolutely nothing to do with bitcoin miners. Additionally Iran has a lot of spare capacity that has made the country a big exporter of electricity. For example about 25% of Afghanistan (Iran's eastern neighbor) is provided by Iran. There were talks of increasing exports by 400 MW to Pakistan (another neighbor in the east). Same thing in the west with Iraq and Syria.
There are also either smaller amounts exported or exports were for a couple of years to other neighbors such as Turkey, Armenia, Turkmenistan, Azerbaijan.
To say that Iran was caught off guard just because of a tiny increase in electricity usage from miners is just silly. The electric company announced 3 days ago that Iran can increase electricity export by 20000 MW.