What elements or aspects of tragedy are common to both Romeo and Juliet and Oedipus Rex plays and what elements are different in each?
In addition to the superb answer above, I would only add:
Dramatic Irony: Both plays have dramatic irony, but the dramatic irony is much more focused and developed in Oedipus Rex where the audience knows, before the play even begins, that Oedipus has killed his father and married his mother. The entire play is a painful exercise in dramatic irony.
In Romeo and Juliet, dramatic irony mainly comes into play in Act IV, when Friar Lawrence and Juliet arrange her fake death. We know that she is alive while the Nurse, her parents, and Romeo do not.
The Three Unities: Oedipus Rex is more unified, according to Aristotle. It takes place in only one time period (one day); it has only one setting (before the palace gates); it has only one action (engineered completely for Oedipus' downfall).
Romeo and Juliet, however, lacks unity of time, place, and action. It takes place over a week. It has multiple settings (Sunday through Friday) in multiple towns (Verona and Mantua). It has a two plots (Romeo's and Juliet's), and even Mercutio's death is as dramatic as theirs (he steals the thunder).
On-Stage Violence: Oedipus was staged as a religious festival to honor the god Dionysus. As such, on-stage violence was not permitted. Jocasta hangs herself off-stage. Oedipus blinds himself off-stage. To commit violence against the self is an abomination in most religions and certainly not ordained by the church / theater.
Shakespeare and Seneca (Roman) brought violence and revenge on-stage. We see the fight in Act I, Mercutio and Tybalt's deaths in Act III, and Romeo and Juliet's deaths in Act V. Lots of murder and suicide was permitted because Shakespeare's theatre was not conjoined with the Church. It was a secular institution set apart from London proper (across the River Thames).
Poetry vs. Prose: Oedipus is written in song (the choral odes) and spoken prose, while Romeo and Juliet is a combination of unrhymed iambic pentameter (blank verse), rhymed iambic pentameter prose (the Chorus' prologue), and prose (servants and comic characters primarily).
To begin, we should first understand what makes a tragic hero; according to Aristotle, certain elements are needed: the main character must be noble or of high stature, the character has some tragic flaw, the character has a reversal of fortune, and the character must have a catharsis, or cleansing, of his or her wrongdoings.
In Romeo and Juliet and Oedipus Rex, the main characters are of noble stature: Romeo and Juliet come from well-to-do families, and Oedipus is, of course, a king. They also seem to have tragic flaws: Romeo and Juliet are very impulsive and jump into a marriage arguably way too soon without considering the consequences; similarly, it can be argued that Oedipus suffers from impulsivity as well since he attacked the travellers on the road for not moving for him. He also attempted to deny or reject fate, a big no-no in Greek drama. Both stories show a reversal of fortune: R & J both die, and Oedipus goes blind and leaves Thebes. Finally, all characters have a chance to confess their thoughts as they meet their own tragic ends.
The only element that is perhaps different is that Romeo and Juliet both die, whereas Oedipus must leave Thebes, blinded and a widower. There may be more, but this is what I can deduce.