Assuming that Doug is not spending the majority of the movie dreaming in a chair at Recall, but everything he experiences is really happening, the proposed series of events could be as follows:
Vilos Cohaagen is administrator on Mars, Hauser is his trusted friend and employee. During the colonization of Mars, Cohaagen has sacrificed many workers by letting them work to death, and allowing others to mutate into hideous forms, due to poor shielding from space radiation and bad air quality. Cohaagen further extorts Mars' inhabitants with high taxes on air, threatening to shut off the air to those who oppose him. This causes a resistance group of Martians (colonists and mutants) to start terrorist actions against Cohaagen's forces, in order to free Mars from his oppression.
During mining operations in the Pyramid mountains, workers discover remnants of an ancient alien civilization. Its purpose was perhaps to make Mars an habitable planet with its own atmosphere; however, that would effectively take away Cohaagen's source of power, so he closes the mine and keeps the finding a secret, maintaining that the alien machinery was there to cause a global meltdown and destroy Mars if it was ever turned on (or he likes to believe that, at least). The resistance leader, Kuato, learns about the secret, and that it may be the key to the salvation of the planet, so he desperately seeks the truth.
Several attempts are made to eradicate the resistance, but the rebels are well hidden among the inhabitants of Mars; infiltration missions fail because many of the mutants are psychic and spot the spies eventually before they can find out who and where Kuato is. So Cohaagen and Hauser set up a delicate plan. Hauser starts spying on a woman called Milena, who is suspected of working with the rebels. He gains her trust by convincing her he wants to get out of Cohaagen's organisation. Just when he is ready to be introduced into the resistance, Hauser pulls out and 'disappears' to make the rebels and Milena think he has been caught and killed by Cohaagen. A trail is set for 'Douglas Quaid' to find his way into the heart of the resistance. Hauser tapes a video to himself, explaining how he wanted to betray Cohaagen, and that Quaid needs to go to Mars to join the rebels. He also makes another tape, one to be revealed to Quaid after Kuato has been killed. A suite in the Hilton Hotel on Mars is rented in Houser's name, and a message is left there with instructions to find Milena. Hauser's memory is isolated and blocked, a bug is inserted in his head and he gets the memory and personality of Douglas Quaid, a construction worker on Earth. One of Cohaagen's spies, Lori, goes to live with him pretending she is his wife, making sure that he remembers nothing of his former life. Other people keeping an eye on Quaid are Harry, who impersonates a colleague on his work, and Richter. None of them, however, are told that Hauser is actually a double agent; they simply believe Hauser is a traitor who got punished by having to live out his days on Earth as Quaid.
The object is to have Quaid return to Mars after a while so he can get into contact with Milena and the resistance again. Unfortunately, this plan gets accelerated when Quaid unexpectedly begins to have dreams of his former life on Mars as Hauser. He is so fascinated by these dreams that he goes to Rekall to have a trip to Mars implanted. However, during the implantation procedure, the scientists inadvertently reactivate Hauser's memory. They wipe it and restore Quaid's personality again, but Harry, Lori and Richter fear that the procedure at Rekall will cause Hauser to resurface again, so they try to kill him, despite Cohaagen's orders to bring Quaid back alive. Cohaagen has another agent deliver a suitcase to Quaid, containing the first Hauser message, the bug extractor, and enough information to get to the Hilton Hotel on Mars and find the message to look for Milena. On Mars, Benny, another one of Cohaagen's spies, helps Quaid to get where he needs to be. But Milena does not believe Quaid's story and sends him away. Benny relays this information to Cohaagen, who calls in Dr. Edgemar from Rekall to present himself to Quaid as a memory implant, in an attempt to fool Quaid into handing himself over with Lori's help. It is not quite sure why they want Quaid back now; perhaps they want to reacquire him and try another way to get him to Kuato, now that Milena seems unlikely to be of any help. Despite that Quaid sees through Edgemar's ruse, Richter's men succeed in catching him. He is unexpectedly rescued by Milena, and from there, Quaid fulfills his purpose of meeting Kuato and getting Benny close enough to kill him. Afterwards, Quaid learns from Hausers message how he has been used. The big flaw in this plan was obviously that 'Quaid', the new personality, could not be adequately controlled and defended his own existence, leading to him activating the alien device, and the bad guy becoming the hero.
For this explanation to work, some coincidences need to be accepted; for example, Bob from Rekall, Dr. Lull , the Rekall technician and Dr. Edgemar give a lot of examples of what will happen in the dream, which actually happen later on. (It should be noted that in the audio commentary, Verhoeven correctly states that the quality of the script is exemplified by the fact that two characters can accurately predict the direction the story will go in, yet the film retains its edge-of-the-seat feel.)