It is a multi-purpose word used in an awkward situation, to disagree, to say gross, to signify a time to laugh, or just to shout out whenever you need it!
Coined by Dr.Perry Cox from the medical comedy show Scrubs, it is now used as an overall exclamatory remark towards anything deemed angering, sexy, cool etc.
(pretty woman kisses her male friend without warning; causes a long winded "oooooooh" from the audience)