Staff officers are sometimes seconded to other countries to observe. For example, Lionel Mandrake was seconded to Jack Ripper's command in the movie "Dr Strangelove." Or even more strangely, I've seen navy working on an airforce base.
Truly, officers are tasked between services and to other entities, especially in U.N. peacekeeping missions. But, IMHO, a U.S. soldier has no business being ordered around by a foreign power - even the U.N. - and should never be subjected to an International Criminal Court for his actions while executing lawful commands from his superior officer. Those issues are more appropriately handled at the command level. Otherwise every U.S. soldier on foreign ground performing U.N. peacekeeping duties would be subject to the political whims of the country to which they are assigned.
As betty boop noted, the U.S. soldier is sworn to defend the United States against her enemies foreign and domestic - not the United Nations.
IMHO, the worst possible result at the U.N. would be global governance, global taxation, global judiciary and global military force. But this is precisely what the Maurice Strong's of the world would like to see...