Is it unethical to apply to/attend a PhD program knowing you MIGHT end up leaving it under a particular circumstance? Hypothetically, suppose one applies to and is admitted to both a funded PhD program in Field A and a master's program in Field B at the same university, in different departments. Suppose there was a structure in place at the university for both programs to be undertaken concurrently (an implication of this is that I would not have to pay tuition for the normally unfunded master's program).

Is it unethical to attend both programs, knowing that depending on how the Field B master's goes, I may end up leaving the Field A PhD (after receiving my Field A master's) for the Field B PhD at the same university? Note that this is not my intention going in, but simply the one unlikely but possible situation in which I know that I would leave. I don't expect this is likely to happen - and if for whatever reason I don't want to or can't make the switch to the Field B PhD program at that university, I would see the Field A PhD through no matter what.

Furthermore, if it is unethical to attend both programs, is it also unethical to apply to both programs? It goes without saying that I would not misrepresent myself in my statements of purpose to either program (or to my letter writers).
It is not unethical to apply to both programs. 

However, for most advanced degree programs, the possibility of doing multiple programs simultaneously is remote, unless the departments have already established a method for undertaking work between the disciplines. For instance, there may be an interdisciplinary program or a "joint degree" program. In such cases, though, you will find it very difficult to find a funded program that will pay for your studies to complete a degree in another department.