What reason would someone who offered you a PhD position give a recommendation letter for another position? Background: I was offered a PhD position by the advisor of my current masters thesis and also by the corresponding professor at the local university. Now that i thought more thoroughly about pursuing an academic career i want to apply to a different university to gain experience abroad (eg. Switzerland). 

Obviously my advisor and the professor are interested in my work, is there any chance they will support me with a letter of recommendation? Or more generally if the professor likes your work, why would he or she support you to apply somewhere else?

Edit: To expand on the answers, will i risk my chance of PhD at the local university just by asking for a recommendation (e.g. EPFL seems quite competetive)?
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.