It can be done but it may take some work getting done. First, off, are both of you in categorical positions? If so, that will make it difficult, depending on how each program uses its categorical positions in the context of the entire residency training program (i.e., will you already be doing anesthesia rotations as interns).
Secondly, as mentioned above, both programs have to be comfortable with your academic standing and be willing to look at either of you. The switch I helped to engineer a few years ago was during a period of time where the competitiveness had increased, but was still not nearly at the level it is at right now. The programs will have the final say on whether or not they will be amenable to the switch.
At this point, both of you need to to excel in your internships and maintain lines of communication with your program directors. It is ESSENTIAL that you both relay to them that you both believe that your respective programs are excellent programs but that family/exigent circumstances would be tremendously allayed with a switch of residencies. If you are both categorical, this is something that you would like to have done now as opposed to next year, but it will be risky given that the programs have no way to judge either of you in terms of performance.
In either circumstance, understand that you are taking a risk that your current program might decide to drop you. In all fairness to them, they don't want to switch a resident they like for one that might turn into a problem child (as occurred at my program, for which I have been constantly reminded by my former faculty, though thankfully in jest).
If both of you can PM me with your background info and the programs involved, I can look into the situation to see if the programs at issue are flexible and have shown a willingness to accomodate this trade in the past.