I think i would. In the case I'm juggling bags while getting my keys out and my neighbor opens and his the door for me. That will prompt a thanks from me
If we're also friend, i would also greet them, 'hi". To indicate that the interaction is open to conversation out o would follow up with a different sentence.
To say the context doesn't support 'thanks, hi' also doesn't support 'thanks, bye'.