Oedipus Rex is set in the ancient Greek city-state of Thebes. Or, to be more precise, it's set in front of the Theban royal palace. Ancient Greek playwrights were sticklers for the three unities of time, subject, and place, and Sophocles was no different. That being the case, the setting doesn't change throughout the play. Despite this, much of the important action takes away from the palace exterior. For instance, we never actually see Oedipus gouge his own eyes out; he does it off-stage. Such acts of violence and bloodshed were traditionally presented as occurring off-stage in ancient Greek drama, largely due to practical constraints.
The setting of Oedipus Rex forms a focal point for the members of the audience, encouraging them to concentrate on the action, to which they must pay particularly close attention. At the same time, the very simplicity of the setting allows the audience members to use their imaginations to add more richness and depth to the unfolding drama.