If you were to apply to my hypothetical mid-tier PhD program school A and were given funding -- and if I were your advisor and put a lot of work toward mentoring you and advancing you to candidacy -- and I were to find out it was always your intent that you would switch schools to the more elite school B at the first opportunity, then yes I would be miffed.
For example, my school offers tuition waivers and stipends (approx $28,000) to every incoming doctoral student in Arts and Sciences, for six years. This is guaranteed funding. Students are assigned advisors from the first year to work on their projects. We invest a lot in our students. In my case, we're a top R1 but I know my colleagues at mid-tiers try hard to scrounge together packages for their students and make up with even more intense mentoring.
It's one thing to switch schools because of fit issues that come up between advisors and advisees. I would never tell a student who is unhappy to stay. It's also another thing to be scouted and stolen. This occasionally happens. But to come into a program that is providing you with resources with the intent that you graduate (from them), with one foot already out the door seems lacking in ethics.
People often use the marriage metaphor for doctoral programs -- while divorce is always an option and the (unhappy) result of a lack of fit, marrying into a program with the intent of cheating and switching up at the first opportunity is not ethical practice. [Again, some schools don't give you any sort of commitment in the form of funding either, so in that case you are free to explore other options].
There's also a couple of hitches in your plan:
When you apply to other schools, you will need letters from school A -- presumably the reason you are doing this is to get letters from an American institution -- i.e, from us at a moment when we might be none too pleased with your strategizing.
The new school you're applying to will want to know why you're not continuing with the PhD at the old school. If you are honest and tell them that you are switching because you already intended to use school A as a stepping board, they may take it as a sign of your low regard for academic ethical behavior. Someone who cheats once may cheat twice.
On the other hand, applying to an MA/MS program at school A in order to get into a high-ranked PhD program at school B is not only typical but desirable behavior on the part of school A.
p.s. My advisor once told you me that you owe as much loyalty as you are given (in reference to academia). If you are in a program that give you guaranteed funding and where your advisors invest time and energy in you and your project, then of course they will be hurt if you change mid-stream and they learn that was always your intent. If, on the other hand, you owe little to a place that guarantees no funding and your advisor is missing or never assigned.