In Oedipus Rex, is there anything Oedipus could have done differently that would have saved the kingdom?
Oedipus takes many steps to save the kingdom from the plague.
Or, on the other hand, was Thebes doomed from the time the play begins?
I would qualify your question. You ask if Thebes is doomed from the beginning of the play, but it should be noted that it is not Thebes that is doomed in the play; it is rather Oedipus who is doomed from the beginning of the play. Beginning with this premise in mind, it should be recalled that, while Oedipus (and his father Laius) heard what his fate would be before he actually brought it about, the actions which actually caused his tragic fate were committed entirely of his own volition. Even while these actions resulted from a course of events which were meant to prevent their occurrence--e.g. Oedipus fleeing from his adoptive father's house to avoid killing him and killing Laius, his real father, unknowingly nistead--these actions could have been prevented had he, say, decided never to kill anyone in his entire life. Oedipus believes that he can control his fate, and he can, but this is nonetheless distorted by imperfect knowledge. His main flaw is not that he has freewill, but that he knows he has it.
The curse placed on Oedipus is a hereditary curse. In the play "Antigone", Oedipus' sons die by killing each other, Antigone kills herself and Creon (the only one left of the family line now) is left to live alone, as his wife and son have also killed themselves. So, I think there is little Oedipus could have done to save himself or his family.
However, Oeidpus may have been able to save the city of Thebes from such political and social upheaval by listening to Teiresias when he first claims that Oedipus killed king Laius. Oedipus' hubris, or pride, will not even allow him to consider the idea that he, the King of Thebes, answerer of the Sphinx's riddle, could possibly have anything to do with the curse on his town. However, if he listened to Teiresias and investigated the matter further in Act I, the play would be much, much shorter, and the god much less angry when the punish Oedipus (and, subsequently, his family) for being so prideful.