As in most questions involving comparison and contrast, there are some ways in which Oedipus Rex and Macbeth are similar and some in which they are different. The form of both plays (ie the fact that both is a classical Tragedy with a Tragic Hero) is similar. It is the content of each that holds a great many differences.
Let's look at how the form makes them similar. Both follow the construct described by Aristotle in his Poetics for a Tragedy. Enotes describes Aristotle's requirements in this way:
Aristotle defines tragedy as 'an imitation of an action that is serious, complete, and of a certain magnitude; in language embellished with each kind of artistic ornament. . .; in the form of action, not of narrative; through pity and fear effecting the proper purgation of these emotions.'
Enotes goes on to note what sort of hero -- the Tragic Hero -- Aristotle believed a Tragedy to require:
What of the person chiefly concerned in these actions? The tragedy must not bring a perfectly virtuous person from prosperity to adversity, nor raise a bad person from adversity to prosperity, nor yet depict a villain receiving his or her deserts, for none of these would both satisfy the moral sense and inspire pity and fear. The remaining possibility is of a person not eminently good and just but unmarked by vice or depravity, who is brought to adversity by some error or fault (hamartia).
Both of these requirements are met by both plays, Oedipus and Macbeth. They both involve serious events of "a certain magnitude" (The depiction of kings struggling to maintain their power); both deliver these events through action and in verse (heightened language), and both invoke the emotional response of the audience at the downfall of each hero.
Oedipus and Macbeth both fit the definition of a Tragic Hero described above, since both are subject to the same tragic flaw -- hubris, a personality trait most associated with assuming that one is more powerful than, in reality, is true. Both Macbeth and Oedipus are subject to believing that their own power and craftiness will carry them past all obstacles and this is their tragic flaw.
In these plays there are definitely differences in content:
- Macbeth must consciously make a choice to kill to become king; Oedipus kills in the heat of the moment and has no idea that this will lead to his becoming King.
- The oracle that has predicted Oedipus' fate is in place way before the play begins, while Macbeth learns of an "oracle" that he will be king along with the audience in Act One.
- Macbeth must battle his external enemies to attempt to retain his throne, while Oedipus' enemies are his own internal battles.
The question that you have asked is potentially huge in scope, and I have given you some general ways in which to begin a comparison of these two plays. Below are links to more information on Poetics and the study guides for Oedipus Rex and Macbeth. You might also find the Enotes page called "How to Write a Compare-and-Contrast Essay" helpful.