Can a country simply decide to tax non-residents that have no connection to it on foreign source income? The answer is clearly no, both from a practical perspective and, I would argue, from a customary international law perspective. The fact that this rule is followed from a sense of legal obligation is illustrated by the behavior of the US… precisely because the US felt bound by a customary international law rule not to tax non-residents directly on foreign source income…
Reuven Avi-Yonah. International Tax as International Law. University of Michigan Law School (2004)
[I]nternational law is part of our law, and must be ascertained and administered by the courts of justice of appropriate jurisdiction as often as questions of right depending upon it are duly presented for their determination. For this purpose, where there is no treaty and no controlling executive or legislative act or judicial decision, resort must be had to the customs and usages of civilized nations, and, as evidence of these, to the works of jurists and commentators who by years of labor, research, and experience have made themselves peculiarly well acquainted with the subjects of which they treat. Such works are resorted to by judicial tribunals, not for the speculations of their authors concerning what the law ought to be, but for trustworthy evidence of what the law really is.
Justice Gray, Paquete Habana Case 175 US at 700 (1900).