It happens all the time.
At the risk of borrowing from one of my recent contributions - the tritone sound pulls a listener's ear in a meaningful way to a tone that's one half-step up from the involved notes. If we play a C-F# interval, music theory tells us that the most satisfying resolution to this interval will either be (enharmonically) to Db or to G. You can imagine a guitarist or a pianist simply holding a C-F# and then not moving their hands/fingers and simply adding the 'missing' root of the chord; D-C-F# implies D7 which is the V7 of G major, while Ab-C-Gb(AKA, F#) is the V7 of Db major.
This, along with the idea of relative minors and other substitutions, allows people to 'justify' all kinds of interesting changes, without even doing a ton of modulation. Consider the fairly common chord progressions of I -> III7 -> IV, or I -> III7 -> vi. Or to contextualize them a little bit, C -> E7 -> F // C -> E7 -> Amin. E7 contains a G#, which is not in C Ionian or A Aeolian; however, it is the V7 of an A minor chord. With A minor being relative to C major, as well as being squarely between F major and C major on the circle of fifths, sort of gives it what I'd consider an 'auditory seal of approval'. (I'm sure there's a better term for what's occurring there, but really think about it; F + A minor = a neatly stacked Fmaj7. C + A minor = C6, but it's got a big M6 between the root and the 6. This doesn't result in the death of a family member or anything, but it is just interesting food for thought IMO.)
Anyway. Even outside of songs which modulate to go to the bridge, or to close the song on a different emotional level than it started, consider a tune like Giant Steps. Coltrane is basically 'switching' so often between Eb, G, and B that it is just about useless to call the song as being in any key. In particular if you attempt to improvise over it; those Eb licks will not serve you very well over a ii-V-I in G. It doesn't really inform anyone's playing to consider the song as having a single key.
Atonality doesn't have to play into it; there's no need to look into tone rows unless you're really looking for something different to play around with. There's a ton of jazz which critically redefined the mentality of playing 'in key'. People cite Kind Of Blue as being a landmark album for a reason; it pushed a lot of what informs people's modern sensibility on how to improvise with both the motion of the chords as well as the sound of the song in the moment; as opposed to committing oneself to learning how to solo over every ii-V7 progression as if they were static chord changes that cannot be deviated from.
This has gone on to inform a lot of genres' approach to music. Consider every cookie-cutter forgettable Top 40 'hard rock' band you've ever heard which makes use of drop-D tuning and that Eb5 power chord to 'return' to the D5. That's chord substitution without the tritone interval to 'justify or explain' the placement of a b2 in a 'key' that would otherwise have sounded to relative to D minor instead of "D diminished, until it isn't." The tonic might be D, but that's not a key, it's a note.