The marketing term "Shared Universe" is a relatively new concept, as is the expectation that every single thing within an arbitrary marketing structure match each other perfectly in narrative and aesthetics.
And yet, works of fiction have been
created (and marketed!) with that understanding for a long time. The exact definition is a little fuzzy and varies a bit by medium (does it require multiple stories? multiple central characters? multiple series? multiple authors? multiple media? etc.), but there are lots of examples.
For instance: Marvel and DC Comics have been doing shared universes among multiple comics series since 1961 and 1959 (or arguably 1941!) respectively; Marvel in particular has always been pretty explicit about it, and has been marketing under the term "Marvel Universe" since at least 1982 when it published its first
Official Handbook. In literature, the Oz books have been published since 1900, Burroughs' Barsoom since 1912, and Robert E. Howard's "Hyborean Age" dates back to 1929. Larry Niven first began writing his "Known Space" stories in 1964, and opened it up to other authors at least by the 1980s. In film, Universal was crossing over its monster characters as far back as
Frankenstein Meets the Wolf Man in 1943, and Toho was doing the same with its monsters since
King Kong vs. Godzilla in 1962. On TV, the
Mary Tyler Moore-based and
All In The Family-based "families" of spinoff shows date back to 1970 and 1971, respectively. And all that's just some of the most
widely-known examples, and all
before the launch of TNG in 1987. Push forward into the 1990s, and examples multiply like rabbits.