Initialism of "oh my God".
Its first known attestation is in a letter from John Fisher to Winston Churchill, dated 1917, as "O.M.G."
(chiefly Internet, slang) An exclamation of excitement, surprise, amazement, or shock. (Oh, my God!)
"OMG, I just won tickets to a concert! Today is the best day ever!"
"...and then he said I was ugly, so I punched him in the face." — "OMG, really?"
"...and then I found out my fish died." "OMG, I'm so sorry to hear that."
(computing) Initialism of Object Management Group.