What reason would someone who offered you a PhD position give a recommendation letter for another position?
Yes. There is a good chance that they will support you by writing a letter. This happens frequently.

More generally, they will probably support you when it doesn't seem to immediately and directly benefit them, because everyone benefits from a supportive and connected community. People moving between institutions is almost always considered to be a good thing. Even if they lose a good student now, the community is what brings most good students; you and your future advisors will likely recommend your current advisors to students at your new institution(s), for example.