When you're in the key of C major and you use chords from C Dorian, Phyrgian, Lydian, Mixolydian, Aeolian, and Locrian. Why does it sound acceptable to use those chords, and does it work with all chords from those modes and can any mode be used?
It might be useful to think about your question a different way. Rather than trying to classify chords according to which modes they are in, forget about "modes" and/or "keys" and just consider the root progressions of successive major or minor chords. There are three basic groups, when the root moves up (or down) by the interval of a second, a third, or a fourth.
The root interval of a fourth produces a "dominant-tonic" or "tonic-dominant" harmonic progression.
The root interval of a third means that the two chords share some common tones, since the chords are themselves constructed by stacking intervals of a third.
The root interval of a second doesn't have such a clear cut function, but it can be an effective part of a longer progression. One example is the interval of a second creating a "secondary dominant" of the following chord - for example progression like C - Dmin/Dmaj/Dbmaj - G - C or even C - B - Emin (as in the start of Mendelssohn's "wedding march", in the key of C)
The first chord of each musical phrase can have almost any (or no) connection with the chord at the end of the previous phrase, so long as the following chords move towards re-establishing a connection that the listener can understand.
In the renaissance period, using meantone temperament, composers didn't think so much in terms of "keys" as in terms of "the set of major and minor chords which were in tune in the given temperament". A chord progression (in the nominal "key" of G) like G - F - C - Am - G - Eb - Bb - C - G - D - G (as used by William Byrd, for example) makes good musical sense, whether or not one gets tied up in knots trying to make it fit into any particular "theory" of harmony.
Modal interchange is typically a way to simplify looking at chords outside of a scale/key. It's not that it's the only way to view the chords and typically that is far from true, but it gives the non-dictation/chromatic a simple context in a parallel scale/mode. There are two main phenomena which allow this to be extremely common, which are common tones in the chords/scales and chromatism.
Even when considering the furthest you can be away from C Major which is C Locrian, you still have 2 notes in common which are C and F. It's not a lot in this specific case, but if playing an F minor chord in C major you would recoginze that you could play a C Locrian (or F Phyrgian) scale over that chord and give your progression a very different flavor while using the common tones to keep you from going too far outside the key/scale you are in. The chord itself F minor is pretty close to an F major chord, just with the third lowered a semitone and that difference while being pretty big adds a lot of flavor which goes into the next topic of chromaticism.
The chromatic opportunities that can be achieved in modal interchange are what most people use modal interchange for, and really helps make progressions more interesting. For example, in one of my favorite progressions I - ♭VI - IV - V, while you can look at it as simply borrowing the ♭VI chord from C minor (Aeolian), the voice leading inside the progression is much more interesting as seen below:
X:1 L:1/4 M: K:C V:1 clef=treble "I"[C E G] "bVI"[_A C _E] "IV"[F A C] "V7"[G B D F] %
As for the question does it always "work", the answer is simply no as not even every progression you make with only diatonic chords "don't work". If you keep the two ideas I stated in mind of common tones and it will typically work, however you still need to see and hear what you do and the effect it has on the progressions.
I wonder whether you mean what you've written. Dom has explained perfectly well, but did you really mean C Ionian, C Dorian, C Phrygian, etc.,all based on 'C', but all actually belonging to completely different keys.
For example, C Ionian has C,D,E,F,G,A and B, whereas C Phrygian has C,Db,Eb,F,G, Ab and Bb, and C Lydian has C,D,E,F#,G,A and B. So, between all the modes of C - all 7, making chords which come from each mode, there is just about every chord known to man available, from all the different notes!
So - if as you say, you're playing in C major, the opportunity to play most of these chords is very slim. Dom has explained how they could fit, but I think you actually meant the chords of C Ionian, D Dorian, E Phrygian, etc., which are the same chords for each - made from the same 7 notes. Since there is now a finite number of chords, each triad containing notes from the parent major key of C, it makes it easy to understand how, when you're playing in the key of C major, that the modes and chords from that parent major will fit.
NOTE: the terminology is confusing. C Dorian contains the notes from Bb major,(centring around C), whereas the Dorian OF C contains the notes from C major (centring around D)
When looking for a new, interesting harmonic colour in a piece of music, we don't go through a catalogue of 'permitted' modal interchanges. We MIGHT think 'let's try this chord shape shifted up or down a step'. Or perhaps 'let's try this chord with one (or more) notes slightly shifted'. Or even 'what's the GREATEST contrast I can find to the home chord?' (funny how often an F♯ chords gets thrown into a C major passage, purely for shock value :-) )
Then the sort of theorist who's uncomfortable with anything being 'out of scale' starts looking for a way to make these chromatic chords not REALLY chromatic, but sort-of extended diatonic. And he can usually find one.