Mishna Berurah 110 (70) [29] says:
that although we say Tefilas Haderekh when we have left town, that's only at the beginning of the trip but when we stay overnight on the way, we can say THD when we get ready to leave even though we are still in town, because we have already started on the journey (yesterday).
וכ"ז בתחלת יציאתו מביתו אבל כשהוא לן בדרך יוכל לומר תה"ד בבוקר כשמכין עצמו לצאת אפילו כשהוא עדיין בעיר דכבר החזיק בדרך
That is understandable if we are traveling further onward on the second day; but can we say THD in town when we are returning home on the second day?