When playing a 12 Bar Blues, it is more common to play chords , I IV and V as dominant 7th chords than major chords. Like the major chord, 7th chords can be derived from the major scale. A 7th chord is obtained by adding the flattened 7th degree (note) of the scale to a major chord.
Because the notes of a dominant 7th chord are the first (1), third (3), fifth (5) and flattened seventh (b7) notes of the major scale, the chord formula for the seventh chord is:
Once you know the formula for any chord, you can construct it in any key by taking the root note and adding the other notes from the major scale with the same name as the root note. For example, a G7 chord can be constructed from the 1st, 3rd, 5th and flattened 7th degrees of a G major scale, an E7 chord contains the 1st, 3rd, 5th and flattened 7th degrees of an E major scale, etc.
The flattened 7th degree of a 7th chord is not in the major scale but is instead an alteration to get the required sound for the chord. When you put three 7th chords together as chords I IV and V of a key in a 12 Bar Blues progression, there are several notes in the chords which are not usually in that key, but these notes are necessary to create a Blues sound.