As with most ethical situations, the answer is likely that it depends on the context, your relationship with your Ph.D. advisor at your home university, and the field that you are in.
For example, if you will be teaching or working in a lab at your home university, then you will likely be providing a valuable service to your professor and the university in exchange for funding. I don't know about Germany, but I know in the United States, students don't have any obligation to stay at one university, and I know people who have successfully transitioned from one Ph.D. program to another, without repercussion.
However, when you get to the Ph.D. level, the professional world often gets a lot smaller, and faculty members may have relationships with one another. If you were to unexpectedly leave the program at your home university, you risk damaging your professional reputation, and you could be seen as unreliable when you are looking for work.
I personally believe that it is more ethical to be upfront with your home university, although doing so could put your funding and your ability to stay at your home university at risk.
These conversations can be extremely difficult. As an educator, I personally care much more about my students than about the university at which I work, and I would completely understand if a student found an opportunity that is more congruent with their long term plans.
You could also intentionally time when you disclose to your advisor at your home university - wait until after you have started working at your home university and then tell them that you are applying to the program in the U.K. That way they will hopefully have a heads up that you may be leaving, but you will have already been admitted with funding.
You likely know your advisor better than anyone on here, and thus you are in the best position to decide what to do.
In summary: it is probably more ethical to tell your advisor at your home university that you may be leaving, although it is also not particularly ethical for a faculty member to act punitively against a student for pursuing a better opportunity.
This is an incredibly difficult situation to be in, and I wish you the best!