You are right but it's not necessarily in a "hostile territory." Troops have "home bases." When they are deployed, they are moved from their home bases to a position where they can address whatever mission they are charged with. So, it can even mean the movement within the home country or to an allied territory.
For example, here is an unclassified CIA document from the Cold War, entitled
SOVIET ANTITANK GUIDED MISSILE SYSTEMS NOW DEPLOYED IN CUBA. EAST GERMANY. AND IRAQ Note that all those countries were allied with the Soviet Union. And the word here means "positioned," "employed."
Etymology: French déployer, literally, to unfold, which was used when a military formation (a column for example) was unfolded/"open[ed] out so as to form a more extended front or line."
Example from 1870: "The right wing, having deployed into line, began to advance."