Wow, this is actually a good question lol...
As far as I know, if your funding is confirmed in the offer letter sent to you, that means this money has been put in graduate school's annual budget. So you will be safe in the first one or two years... However, if your adviser moves after you enter the program, well, the situation will be more complex and it's hard to tell. Generally, if you are not admitted to the candidacy yet, you may have to look for funding for your future PhD life. Some "nice" advisers may suggest you move with them and start your new PhD life in a new institute. Or you may contact other PI in the program and ask if they could support you. If you couldn't find enough funding for your PhD, you have to quit.
If you have already been admitted to the candidacy when the adviser moves, you are totally safe. In this case, no one would fire you unless you quit your PhD voluntarily.