But wouldn't it be awesome if the writers had said "fuck it, let's do a crossover without telling our bosses"? Yes, it would, and we know this because it happened a bunch of times in the '70s -- The Avengers and the JLA would "coincidentally" fight obvious copycats of the other team on the same month, or a story that started in an issue of DC's Aquaman would sneakily continue in Marvel's Sub-Mariner. This was possible due to two reasons: 1) the publishers didn't always bother to read the books back then (especially the "guy who talks to fish" ones), and 2) while the companies hated each other, the creators were all pals and would sometimes party together. In fact, the best example of a secret crossover involves the writers doing exactly that inside the comics.
In 1972, DC writer Len Wein and two of his Marvel counterparts were hanging out at the Rutland Halloween Parade in Vermont when they realized that place would make the perfect setting for a superhero crossover, since everyone was already dressed in ridiculous (and potentially copyright-infringing) costumes.
via Comics Alliance
Really? Your name is Marv Wolfman and that's who you dress up as?
So they did that. In Marvel's Amazing Adventures #16, we see the three writers driving to a party in Rutland when they run into Beast of the X-Men (whom they fail to recognize, despite getting paid to write his comics).
"No, Batman, come back! I have so many questions!"
After many misadventures, the writers are seen reaching the party in DC's Justice League of America #103, only for their crappy car to get hijacked by a wizard who was just fighting the JLA. Also, Len Wein's wife is temporarily transformed into Supergirl.