Are you asking if JS can Request Cross-domain? If so...
That being said, not sure specifically how SO is doing it.
Are you asking if JS can be loaded cross-domain? If so...
Yes. Similar to images, mp3's, style-sheets, etc., Anything public really. If it's out there in the open, then you can load it. Google hosts many js-libraries in this fashion - you just load them from the central server, meaning your visitors may already have them cached.