In the USA you can get a credit on your taxes for the amount of foreign tax paid, regardless of whether it was withheld or you paid it after he fact. This can eliminate the double taxation effect. In you example, let’s say you earned $1000 in a foreign country and paid $300 foreign tax. In the US you are taxed on the $1000, let’s say $400, but you can credit the $300 and only pay the incremental $100 of tax.
However America taxes world wide income, so it may be different in your country. You should probably ask a tax or accounting expert.