The ending of the 1985-1986 and the final scenes of the season finale, "Blast From The Past" was such a tightly guarded secret, what was actually shot the spring day Victoria Principal shot her scene was Pam waking up the day after marrying Mark Graison (John Beck) and finding him dead in the shower. Had the dream season not been used as a plot device to resurrect Bobby Ewing, cousin Jamie (Jennilee Harrison) would have been killed in the car explosion meant for her brother Jack and Sue Ellen would have been blinded after being caught in the explosion at Ewing Oil set by Angelica Nero for J.R.
Steve Forrest appears in a few episodes toward the end of the dream season as well in what is very blatantly setup for the "Is he Jock Ewing?" storyline but it was dropped for obvious reasons until the dream season reveal had blown over. Forrest reappears later in Season 10 as Wes Parmalee for the same storyline, posing as the resuscitated Jock, and was ultimately revealed to be a fraud.
The alternate explanations for Bobby's resurrection as described in this thread and corroborated on UltimateDallas are accurate - the plastic surgery, the dream, and the "he didn't really die, he was just recuperating elsewhere."
Barbara Curran's excellent retrospective book on the show,
DALLAS: The Complete Story of the World's Favorite Primte-Time Soap also details that Leonard Katzman, showrunner of the series and only a minimal outside/non-DALLAS production crew were involved with shooting the Bobby-in-the-shower reveal, on a separate soundstage months later and shot under the guise of Patrick Duffy doing a shower soap commercial:
PATRICK DUFFY:
"We did an Irish Spring commercial. We took all day and had cases of Irish Spring. And I turned around in that shower a hundred times, all lathered up, turned around and go, 'Good morning. And you can have a good morning too, if you wake up like the Duffys.' And we did this commercial over and over and over again so that they would think it was really that. Katzman "cut out just that one little part [where Bobby says "Good morning"] and it was taken to New York by briefcase and put into the master just before airtime."
--DALLAS: The Complete Story of the World's Favorite Primte-Time Soap, pp. 219
The scene was not included in any of the distributed drafts of the script. The cast was informed Duffy was returning the day the scene was shot but it was not elaborated on nor any explanation of how. Even Victoria Principal didn't know how it was going to happen until much later because if you watch the scene, it's very clear that Duffy's one shot was done completely separately:
[yt]
At some point, Steve Kanaly (Ray Krebbs) gave an interview offering that the explanation asks DALLAS fans to "accept a lot."
* * *
Until the dream season split, KNOTS LANDING and DALLAS essentially maintained their continuity with each other, but after Bobby was killed in the dream season, Gary had a relapse of his alcoholism and later fathered twins with Valene, one of whom they named after Bobby. The producers at KNOTS were so happy with the storyline that season that after Bobby was resurrected, it was not mentioned again on KNOTS. Gary and Valene return once more for the final episode when Joel Grey takes J.R. on his little "It's A Wonderful Life" trip, and again in the season two of the 2012 revival after Larry Hagman passed away. The entirety of the show though is not a dream; the first several years of the show feature multiple crossovers, including J.R. visiting the cul-de-sac to cause trouble for the residents of Seaview Circle, sometimes in cahoots with Abby and other times just for shits and giggles on his own.
KNOTS was actually conceived first but the network wasn't interested; David Jacobs then created DALLAS, which was such a hit, CBS wanted another show, and Jacobs had KNOTS ready to go and it (KNOTS) went on to a successful 14 season run on the network.