If you define "dark mode" as a single, system-level switch that flips the entire interface (and participating apps) to a dark palette, the first modern OS to ship it out of the box was Windows Phone 7 ...