As suggested by @Jdlrobson in T339058#9201151, we should move the default OOUI overlay and window manager (OO.ui.getDefaultOverlay() and OO.ui.getWindowManager()) inside the MediaWiki teleport target (require( 'mediawiki.page.ready' ).teleportTarget). This will allow skins to style the dialogs/dropdowns/etc. provided by OOUI, Codex and any future libraries with just one CSS override (or one line of JS). See T347199: Apply skin body styles to teleported elements for context.
We could add an overridable method in OOUI, which would be used by these two methods, and overridden in MediaWiki here: https://gerrit.wikimedia.org/g/mediawiki/core/ /master/resources/src/ooui-local.js. (I considered just overriding these two methods in MediaWiki directly, to avoid depending on a new OOUI release, but it was ugly, and there's no hurry.)
OOUI itself shouldn't have any references to MediaWiki teleport target, since it's supposed to be independent of MediaWiki.