The proper term for your "compatible" is "diatonic", which means "involving only notes proper to the prevailing key without chromatic alteration."
I'll expand a bit on Dom's excellent answer if I may. There is a good deal of music theory around using notes other than the diatonic ones. One of the most often-used ones is sharping the 7th note of the minor scale, to lead more powerfully to the Tonic. (The Tonic is the first scale degree. The terms for all the scale degrees in order are Tonic, Supertonic, Mediant, Subdominant, Dominant, Submediant, and Leading tone. Of these, you will most often hear Tonic, Subdominant and Dominant.)
I'll go into some detail on this. I'll use A minor to show the diatonic chords of the minor scale. A minor has the exact same notes as C major, just starts on A instead of C (A minor is therefore the relative minor of C major, and C major is the relative major of A minor):
a bo C d e F G
i iio III iv v VI VII
Note that I use lower case for minor and upper for major, with a o for diminished chords. Dom's way is more common in guitar music, and mine in classical music theory books; of course he has done the same for the scale degree numerals as I have.
I'm going to step back a bit and explain the relationship of the Dominant and Tonic chords in a major key. The triad (a "triad" is a chord consisting of a note, the note a third above it, the note a third above that one, called the root, third and fifth respectively) built on the Dominant (5th) scale degree (a V chord or "five chord") pushes powerfully towards the Tonic. That's where it got its name, actually, it's the "dominant" chord in the scale. Try playing a G chord (not a G7, that's next) followed by a C, and you should hear this effect for yourself.
Now, you have probably heard of a "Dominant 7th" or "five seven" chord. In C, this chord is the G7 chord, GBDF. This chord leads ("resolves") even more powerfully to the Tonic. Try playing these for yourself and see. Then, try playing BF followed by CE, and you will see the "innards" of why this works.
Ok. Now, try the same thing in a minor key. Play E minor followed by A minor. Not quite the same effect, is it? Try playing E minor 7 (EGBD), the diatonic Dominant 7th chord in A minor. Missing something? Try playing GD followed by AC, and those "innards" just aren't there, are they? The reason for this is that GD is a "perfect fifth, whereas BF (the one we used in C major) is a "diminished fifth", commonly called a "tritone". It's a half step less than a normal fifth, and is more dissonant. Creates more tension therefore, which resolves when you move to the other notes. So, what do we do? Typically, we raise the 7th note of the scale. Try playing E dominant 7 (EG#BD) followed by A minor. Try playing G#D (there's our tritone again) followed by AC. You'll notice that the pull to A minor is much stronger now.
So, that's why we sharp the 7th a lot in minor keys. As you can see, this is one page out of a pretty large book. I hope it gets you started. :)