One thing worth remembering - to start with - is that rock music doesn't necessarily obey the laws of functional harmony that conventional analysis is based on. It plays fast and loose with the rules. As an old teacher of mine used to say "rock is post-tonal". I don't entirely agree with him, but I know what he meant.
IOW, there is (IMO) an idea of tonality involved - usually of some kind of key centre - but rock is not much interested in chord "progression" (in the sense in which classical or jazz musicians would understand it). Rock musicians make judgments by ear, usually with some knowledge of basic theory (major/minor keys, I-IV-V), but not as something to be followed religiously. They don't know enough theory to cover all the sounds they want to make, and many quite like the idea of breaking the rules anyway, looking for weird or unusual sounds.
Having said that, there is logic of a kind in this tune.
Taking the first four chords, we can see that they fall into two pairs, each moving by a tritone: G to Db, then Bb to E. (And of course all four chord roots are a m3 apart: major chords based on the notes of a dim7 arpeggio.)
They are further tied melodically. A D note on the G chord rises to an F - could be the b7 of the chord, but is harmonised as the 3rd of a Db.
The F is then held over on the Bb, where it's the 5th of that chord; it then rises another minor 3rd to Ab - which (as before) instead of being the 7th of Bb, becomes the major 3rd (G#) of E.
So there is a careful symmetry here. It seems as if they are following a simple melodic logic, but looking for a surprising chord to harmonise the next note with each time. They could stay in key, but choose not to.
(Underscores show the similar moves. "=" shows the held (repeated) note.
MELODY: |G F# D |F ========= |F D F G |Ab(G#)
CHORDS: |G - - - |Db - - - |Bb - - - |E - - - |
CHORD TONES: 1 7 5 3 5 3 5 6 3
The following pair of chords does stay more in key. The melodic phrase from the Bb chord is transposed to a C chord (G-E-G-A) and leads up, as before, towards the chord's 7th (Bb). If the previous logic had been employed here, we'd expect the Bb to be harmonised by a Gb major chord. But instead they go for a very harmless sounding Gm.
That Bb now becomes the 5th of an Eb chord, and the motif repeats a m3 up - except that it's not quite the same. The rhythm is the same, but the 2nd note is the #4, not the 3rd: Bb-A-Bb-C. And instead of going on up to Db it comes back to Bb, and the Gm chord again.
So these four bars suggest a G minor ballpark (aelion/dorian).
Then we get the 4-beat descent: Bb-F7/A -Gm-F, leading to Eb, Cm and D: a cadence in G minor - which resolves back to the opening G major.
So the sequence ends with a very traditional piece of functional harmony. In fact the whole last 7 bars are fully within the conventional G minor key. Even the preceding C major chord has a place in either G dorian or G melodic minor - as does the Bb in bar 3 of course.
But (as I suggested) I think it's a mistake to look to key rules to explain rock sequences, to expect every chord to fit the pattern. Normally they do, in fact - allowing for various borrowing rules (modal interchange). But in this case, it takes some stretching to "explain" the Db as coming from G locrian, and the E (or rather Fb) as coming from G ultralocrian (that's 7th mode Ab harmonic minor: G Ab Bb Cb Db Eb Fb) .
In fact, the chords are far more easily explained with reference to the melody - as above.
Second time round, the melody is different. The guitar follows the 3rds of the chords closely: B on the G chord, F on the Db, D on the Bb, running up via F and G to G# on the E. And then down to E on the C chord, which descends (D-C) to Bb, the 3rd of the Gm. That Bb is held over the following Eb and Gm chords.
After the run-down, it just plays Eb on the Eb and Cm chords, then D on the D. (Hardly the most inspiring guitar melody! I guess he thought the chords were so interesting he didn't need to do anything else. Going for the 3rds does, of course, confirm the major/minor identity of each chord as clearly as possible.)