I can’t imagine any country where the legislature couldn’t pass a law revoking s sold license
If a majority government came to power and had this as a major part of their platform I suspect they'd try to get legislation passed, but any other government is not going to expend as much effort on it as would be needed to get it through.
Could the US government cancel outstanding bonds? Sure. Would it harm sales of future bonds? Yep.
It's much better and easier to just buy them back if the will is there.