IIRC, Filmation created the series based on Mattel's failed Conan toyline..They had Conan character molds (for the action figures) lying around and didn't know what to do with them. Mattel bought the license to produce Conan toys back when Universal was producing the first film. But director John Millius produced an very violent, R rated movie that was nowhere near kid friendly, and the line bombed. They showed them to Lou Scheimer and asked-or he volunteered, to come up with something for them. So the show came before anything else.
No, that's not right. The toys were based on a failed Conan toy line, but the MOTU toys first went on sale in 1981, two years before the TV show premiered. There were mini-comics packaged with the toys, followed by a short-lived DC comics series, before the Filmation version. The mini-comics had a very different set of backstories for the toy characters, with He-Man being just a barbarian warrior, and with He-Man and Skeletor possessing two halves of a power sword which, when joined, would unlock the secrets of Castle Greyskull (a concept very similar to one used in Filmation's pre-MOTU series
Blackstar). The characters of Adam, Randor, and Marlena debuted in the DC comic, but may have been originated by the folks developing the Filmation show; it's unclear who came up with them first.