Technically, this is not possible, given the meaning of "phoneme", "allophone" and "complementary distribution". When two actual output sounds appears in non-overlapping sets of contexts (complementary distribution), it is often said that they are allophones of a single phoneme, for example [p] and [pʰ] in English do not appear in the same context, and are said to be the allophones of the phoneme /p/. If there were words like [pɔ] "foot" and [pʰɔ] "cloud", the two sounds would not be in complementary distribution, they would be in contrastive distribution, and they are not allophones of a single phoneme.
The situation you describe is like the latter case: you have both [er] and [ær] in surface forms. Clearly, /e/ and /æ/ are distinct phonemes in the language. Therefore, the relationship is not phoneme-to-allophone, it is morphophoneme-to-phoneme. I assume in your example that there is some evidence showing that certain instances of [e] before [r] derive from /æ/, and also that some instances of [æ] before [r] derive from /e/. A paradigm along the following lines could support such a claim: [sæ] "to say", [ser] "says", [se] "to see", [sær] "sees". This does not clearly establish whether non-alternating [pær] "pear" is /per/ or /pær/. The characteristic of this rule is that there is a feature-exchange where [αX] becomes [–αX] in some context.
This is a topic that has been touched on in the history of generative phonology, because such a situation would motivate "minus-alpha" rules that swap feature values. What is crucial is that the two cases have to be applied simultaneously (if there are two separate rules +X→–X and –X→+X, there will be merger of outputs no matter what the order of the rules is). A handful of examples have been posited over the past 50+ years, and none of them have survived scrutiny. For example there is an infamous length-switching rule for plurals in Dinka from Gleason's workbook where long vowels become short and short vowels become long, but the actual situation is that single-plural forms involve dozens of random changes and you just have to memorize which change gives you the plural. SPE makes a claim for Austrian German which basically take standard German as the input and computes the Austrian pronunciation from that (i.e. lacks any synchronic basis). The English Vowel Shift rule has that character, at least in the way that the rule is envisioned in The Sound Pattern of English (but it is a highly controversial claim to say that there is such a rule in English phonology).
Robust, internally-motivated examples of swapping rules do not exist in the literature. One explanation for that gap is based on learning, that it would be too hard to learn and instead you should just learn that [pær] is /pær/. But my mini-paradigm above establishes that the fact patterns could indeed lead one to learn such a relationship. A formal explanation for the lack of such swappings is, as hinted at above, the consequence of ordering – no single rule can do it, and any ordering of rules gives you neutralization. But of course you have to have a particular theory of rules beyond simply stating underlying-surface mappings.