Quoted from the OED Word of the Day:
doh, int. NEW EDITION:
draft entry June 2001
colloq. Brit. /d/, U.S. /do/ Forms: 19- d'oh, doh, dooh. [Imitative. Cf. OH int., DUH int.
Popularized by the American actor Dan Castellaneta who provides the voice for the character Homer Simpson in the U.S. cartoon series The Simpsons. The quotation below is his own description of its origin:
1998 Daily Variety (Nexis) 28 Apr., The D'oh came from character actor James Finlayson's "Do-o-o-o" in Laurel & Hardy pictures. You can tell it was intended as a euphemism for "Damn". I just speeded it up.
Although the word appears (in the form D'oh) in numerous publications based on The Simpsons, the scripts themselves simply specify annoyed grunt (as did the very earliest). Unofficial transcripts of the programme suggest the first spoken use was in a short episode, Punching Bag, broadcast on 27 Nov. 1988 as part of The Tracey Ullman Show. Its earliest occurrence in the full-length series was in the first episode Simpsons roasting on an Open Fire, broadcast on 17 Dec. 1989.]
Expressing frustration at the realization that things have turned out badly or not as planned, or that one has just said or done something foolish. Also (usu. mildly derogatory): implying that another person has said or done something foolish (cf. DUH int.).
1945 T. KAVANAGH It's That Man Again (B.B.C. radio script: 8th Ser. No. 166), Tom: Yes, out of the nest-Diana: What nest? Tom: In those whiskers-Diana: Dooh! Its [sic] no good talking to you. 1945 T. KAVANAGH It's That Man Again (B.B.C. radio script: 8th Ser. No. 167), Diana: The man I marry must be affectionate and call me 'Dear'-Tom: Oh you're going to be a stag's wife-Diana: Doh! Tom: Same thing. 1952 A. BUCKERIDGE Jennings & Darbishire xii. 183 'Doh!' An anguished gasp of exasperation rang out loud and clear as Mr Wilkins found his voice again. 1989 Beano 11 Feb. 23 (caption) [Speaker is a man who is knocked against a bus stop.] Doh! 1991 Chicago Tribune (Nexis) 15 Nov. (Friday) H, 'The movie had one good point: It wasn't the worst movie I've ever seen.' 'It was the worst movie I've ever seen.' 'Doh!' 1993 HP Professional (Nexis) July 28 Along their long path ISO sort of missed local area networks and network management, which gave the market over to TCP/IP and related technologies. As Homer Simpson would say: 'Doh!' 1996 A. FEIN et al. Simpsons Comics strike Back! 14/2 'Look out, you dern fool! You're gonna cut off your...' 'D'oh!!!' 1998 N. JONES Hollyoaks (Mersey TV transmission script) Episode 256. 44 Cindy: What are we doing here, anyway? Paul: Doh! Use your head, eh?