Do entire countries suffer punishment for their sins?
Yes, Lord Rudra destroys evil countries.
From the Mahabharata:
In consequence of the sins perpetrated by sinful men, the god Rudra
appears in the kingdom. Indeed, the sinful by their sins bring upon
them that god of vengeance. He then destroys all, the honest and the
wicked alike (without making any distinction).
Whence does Rudra spring? What also is his form?
Kasyapa said, 'Rudra exists in the hearts of men. He destroys the bodies themselves in which he dwells as also the bodies of others...'
"Aila said, '....it is seen among men that they lose their senses and are slain through lust and malice.'
"Kasyapa said, 'Fire, blazing forth in one house, burneth a whole quarter or an entire village. Similarly, this deity stupefies the senses of some one and then that stupefaction touches all, the honest and the wicked alike, without any distinction.'
So, what this passage is saying is that Shiva punishes evil kingdoms with destruction, and how he does it is by inciting hatred, lust, and malice in the people of a country causing the people to kill each other.
Rudra may also punish a country by causing that country to be invaded by a foreign military, because even in that case the cause is hatred, lust, and malice, and Rudra is the deity presiding over those qualities and incites them in people.
As for what sins a country can commit to receive such a fate:
"Kasyapa said, 'Ruin overtakes the kingdom of the Kshatriya when the
Brahmana and Kshatriya contend with each other. Robbers infest that
kingdom in which confusion prevails, and all good men regard the ruler
to be a Mlechcha. Their oxen do not thrive, nor their children. Their
pots (of milk) are not churned, and no sacrifices are performed there.
The children do not study the Vedas in kingdoms where Brahmanas
abandon Kshatriyas. In their houses wealth does not increase. Their
children do not become good and do not study the scriptures and
perform sacrifices. Those Kshatriyas that abandon Brahmanas become
impure in blood and assume the nature of robbers.....The four orders of men
become confounded and destruction overtakes all. If the Brahmana. who
is like a tree is protected, gold and honey are showered. If, on the
other hand, he is not protected, it then tears and sins are showered,
When Brahmanas fall away from the Vedas and (in the absence of a
Kshatriya ruler) seek protection from the scriptures, then Indra does
not pour rain seasonably and diverse kinds of calamities ceaselessly
afflict the kingdom. When a sinful wretch having slain a woman or a
Brahmana does not incur obloquy in assemblies of fellowmen and has not
to stand in fear of the king, then danger threatens the Kshatriya
This answer explains why it is fair that entire countries get destroyed as punishment for the sins of evil people within that country.