"Brown Sugar" by The Rolling Stones is in C major, but makes forays into E-flat major (based on the preview of the sheet music at least!). My guess is that the inclusion of these chords can be explained by blue notes present in the pentatonic scale--the flat third and flat seventh scale degrees.
I understand the expressive purpose of these notes in a riff or solo, but here The Stones include harmonies built off these notes, which sees the song departing from it's original key. What I find curious is the effectiveness of this design. It feels loose and playful, yet not lost: the E-flat major chord in bar 9 leads convincingly back to C-major as does the B-flat major chord in bar 11.
I understand that the flat-third and flat-seventh chords are common-place in early rock and roll, but I am wondering if you can explain in terms of harmony, using this song as an example, why these chords function the way they do, serving almost as a dominant in the sense that they lead satisfyingly back to the tonic despite belonging to a different key.