While there are some comedies in which actors engage directly with the audience, most modern comedic plays adhere to the fourth wall convention. That is to say the humorous events in the plays occur while the audience watches them. The actors interact with each other and react to events within the play but they never engage directly with the spectators.
Modern, realistic dramatic plays almost always adhere to the fourth wall convention. Dramas rely more heavily on an audiences' suspension of disbelief than other genres and styles do. It is in part for this reason that dramatic plays almost never involve actors engaging directly with the audience.
Even in the outlandish world of musical theater where people seem to randomly burst into song, the convention of the fourth wall is largely upheld. Singers may turn out to the audience to deliver their numbers yet within the context of the play the songs are delivered to other characters or sometimes performed as a kind of internal monologue detailing what a character is experiencing.
Opera is similar to musical theater in that while people singing their way through life may seem outlandish, it is an accepted convention of the genre just as maintaining the fourth wall is. Opera performers never engage directly with an audience. While they deliver their songs to an audience within the context of the play they are intended as communications with other cast members or internal monologues.