The sources on wikipedia say it was Percy Spencer, an American self-taught engineer. He noticed a Mr. Goodbar candy bar he had in his pocket started to melt from microwaves from an active radar set he was working on. The first food deliberately cooked was popcorn, and the second was an egg, which exploded.