If those bases aren't considered US territory whose territory are they?
In case of United States Army installations in Germany:
" The legal status of Americans stationed in Germany is governed by special international agreements including the NATO Status of Forces Agreement.
People stationed at overseas bases or posts must remember German laws apply to them, too. To protect yourself, know what rights you have as an American. Whether German authorities exercise their right of jurisdiction depends on the circumstances of the case. "
https://www.ramstein.af.mil/About/Fact-Sheets/Display/Articl...
In case of Guantanamo Bay Naval Base:
"At the United Nations Human Rights Council in 2013, Cuba's Foreign Minister demanded the U.S. return the base to Cuba."
https://en.wikipedia.org/wiki/Guantanamo_Bay_Naval_Base#Cold...
Guantanamo is leased like Hong Kong used to be, and has been since the Spanish-American war. It is an exception because the US refuses to normalize relations with Cuba. That is not the case for Ramstein and the European bases, which are generally just there by agreement which does not convey sovereignty.
Another special case is the UK sovereign bases in Cyprus, which really are UK territory; I only know about those because during Brexit they kept getting mentioned in the treaty documents.
Bonus pull out sovereignty section: to whom does Transnistria belong? How about Nagorno-Karabakh?