Most countries have their own sovereign currency. Essentially they can print their currency. So how do countries repay their loans? And a similar question would arise while granting a loan to another country. On what repayment terms are loans granted by one country to another country?
The premise of asking this question is... Can US (for example), say just print money and revive any economy? In fact, it did do in 2009 printed out trillion dollars declared to be used for the health sector... And now it has done again added multiple trillion dollars for infrastructure... And other countries can also do... just that it 'may' lead to a devaluation of their currency. But it doesn't matter for the economy provided it continues to export... The case of zimbabwe was weird coz it was not a self-sufficient economy in the first place...
And US has also removed the gold standard in 1971. So on what basis is currency printed by US?