Is that why the fifth note of a scale is called the dominant?
Yes. The fifth degree of a scale is called Dominant Note. This is a very important note because the chord built on this degree is a Dominant Chord, which has a strong tendency to resolve to the tonal center of the key. (Tonic)
As stated by dvenetian, the G major scale shares 6 notes with the C major scale, allowing you to Modulate between those two keys.
Of course you can Modulate to the key of C minor, via the G7 chord as well.
NOW - how does it work when you have say 6th String fret 3, 5th string fret2. This pair of notes still sound OK together, and it is the first and third of G major.
In the key of G major, the distance from G to B, constitutes an interval of Major 3rd (M3).
And sound fairly good because is considered of Imperfect Consonance; whereas the interval from G to D is considered of Perfect Consonance.
But why is it G and not a chord (or DIAD) of B, which is the other note???
The reason why G7 functions as Primary Dominant is because the B note present in the G7 chord, constitutes the Leading Tone in the key of C major.
The leading tone resolves to the tonic from a semitone bellow.
Hope that helps.