I have some questions for you, about the theory..

If I have a song in which I play D5, C5, G5, A#5, C#5 in this sequence, can I play as solo something from the G BLues scale? (becaues those notes are taken from that scale)
IN other words, should I look only at the tonic when I decide a scale or the solo, or should I look also at the other note of the power chord?
If I cannot play the G blues scale, what scale can i play?Is it one only scale possible or i have to change with the chords?

That's a sample i recorded (sorry for the bad quality)

And another doubt: this two songs are respectively in Emajor and Dmajor, can i play on them a solo from the respective major scale, or I have to follow some rules?

Thanks for the attention