What kind of town is the Torah talking about?
Rashi and Ramban (citing the Sifri): It is talking about the towns of a Milchemes ha'Reshus, 1 incorporating wherever they may be, but excluding the conquest of Cana'an and the war against Amalek.
To whom do the peace-terms apply?
Ramban: To all potential enemies - even the seven nations, 1 as we learn from Moshe, who invited Sichon to make peace, 2 and the difference between Milchemes Mitzvah and Milchemes R'shus applies only 3 where they decline to accept Yisrael's peace terms. 4
Rashbam: To all but the seven Cana'ani nations. 5
Ramban (citing Midrash Rabah, Tanchuma and Yerushalmi, Shevi'is, 6:1: Indeed, Yehoshua adhered to this command, by sending three letters to all the nations: Whoever wants to make peace should come and make peace; whoever wants to move away may do so, and whoever wishes to fight, let him come and fight. The Girgashi fled, the Giv'onim made peace, whereas the thirty-one kings who came to fight, Hakadosh-Baruch-Hu destroyed them - as the Pasuk states in Yehoshua, 19:20. See also Ramban DH 've'Da' and 've'ha'Rav R. Moshe', with reference to the Giv'onim.
Ramban: Besides the obligation to demand from the Cana'anim that they relinquish Avodah-Zarah, seeing as we are forbidden to live among idolaters - See Shemos 23:33, or to force them to do so without prior condition after they have accepted our peace terms.