It's basically like this...
Every key is made up of 7 notes. And each one of those notes, if you use it as a starting point, is a mode. Like ketsueki said, in C major, E as a starting point is E phrygian. E phrygian scale is E F G A B C D E. All the notes of the C major scale just a different starting position, E. SO now when you go to write out a chord progression, you can think of each chord being assigned to a particular mode. Take this simple progression C F G7. Each chord if you using the C major scale is a different mode. C of course is C Ionian or major, F is lydian, and G7 is mixolydian.
FOr a simple player it's easier just to think of the C major scale when soloing over this progression. But much can be substituted. What I mean by this is instead of using the lydian mode over the F chord. A player may choose to use the Ionian mode instead (F major scale).
The same can be done with all the chords, but some guidelines should be followed at first. Then broken once you have some experience. These are, modes should only be substituted with the same tonal center triad. Major modes with major modes, and minor onces with minor ones.
The major modes are Ionian, lydian, and mixolydian.
The minor modes are dorian, phrygian, and Aeolian.
Locrian is diminished and is rarely substituted.
FOr your first question, subbing the lydian for the Ionian mode is quiet common. Both are closely related. The altered #4 creates a leading tone to the 5th over the root chord. So if you were playing over a C major chord and you were going to G in a run, F# (lydian) is a good leading tone to G.
In vice versa, subbing the ionian mode for the lydian leaves you with a perfect fourth interval over a major chord. Important because a perfect fourth over the root of a chord is called a suspension. AN importnant note in melodic writting.
Whether to use either is a question of where you go next. Sus4 natural resolves down to the 3rd. The Aug4 (#4) resolves up to the 5th. The sus4 can resolve up to the 5th, but the #4 is IMO more colorful and modern sounding.
The mixolydian mode is an odd ball when subbing with the other major modes. The b7 is a tricky and questionable change. USing the harmonic minor mode 'spanish phrygian' is the better and most common substitute for the mixolydian mode.
All the minor modes mix together well. Whether the 2nd and 6th are flat or natural over a minor chord are a question of color. Whether you want it or not, neither question the minor chords integrity.
Got it?
"My whole life is a dark room...ONE BIG DARK ROOM" - a.f.i.