Good question! The answer requires at least a little music theory.
Vocal melodies (or any melodies, for that matter) are likely to use the notes within accompanying chords to some extent. However, melodies are unlikely to only use notes within the accompanying harmony (chords). In fact, melodies would be rather dull if they did! Depending upon the style or genre of music, and also the adventurousness of the composer (I guess), melodies may contain a greater or lesser amount of non-chord tones, notes that aren't in the accompanying chord. Non-chord tones are most likely to be other notes from the key the music is in at that point, or they may even be chromatic within that key.
To illustrate these ideas, here are some examples. Let's say the chord accompanying your melody is an E Major chord, at some point in a piece of music. This chord contains the notes E (root), G# (maj3) and B (5). These are the chord tones; the melody part could just use these notes, although this is unlikely to be very interesting, as it would essentially be restricted to arpeggiating the notes of an E Major chord or even fewer notes. If your E Major chord is part of a chord progression in the key of E Major it could easily use non-chord tones that are also from the key of E Major; these other E Major notes would be F#, A, C# and D#. Non-chord tones can relate to chord tones in a number of ways, for instance as: passing notes; suspensions/retardations; auxiliary notes. (It is worth pointing out that non-chord tones need not be related to a chord-tone in one of these ways; instead they may simply be an extension of the harmony, essentially creating an extended or added chord when combined with the accompanying chord.) Finally, the melody could contain notes neither within the accompanying chord or the current key of the music; these would be chromatic to the key. In this case they would be the notes not in E Major: F, G, Bb, C and D (or their enharmonic equivalents). These would be less likely to be used, but could still certainly be in the melody part. If they are used, it is likely that they would need to resolve effectively to either chord-tones or certainly other notes within the underlying key of the music. Of course, it could also be that the E Major chord is within another key (for instance: A Major, A Minor or B Major, to name just a few). Obviously this would change the non-chord tones likely to be used (i.e. the non-chromatic ones).
Finally, it is worth noting that the chord used at any point within a piece or song, may itself be chromatic to a certain overall key. (Where other chords more strongly define a particular key.) And a major scale (or even other diatonic modes) certainly need not be the only way to organise melody notes or chords in a piece of music. Popular music styles make use of a wide variety of different scales/modes in addition to "traditional" major and minor keys.