1). an onomatopoeia, the sound one makes when delightfully rapidly ingesting something delicious, the context most often used is when scarfing down a delicious food, such as a cookie or sandvich.
2). the phrase is near commonplace on the internet but originated with Sesame Street's Cookie Monster
3). the sound is also used in Team Fortress 2 when the Heavy class eats a deliciously looking "sandvich" after becoming damaged and regains full health.
Cookie Monster: (while making a mess, shoveling what appear to be chocolate chip cookies into his mouth) NOM NOM NOM!
Heavy: "What was dat sandvich? Kill dem all? Good idea! Ahahaha!" (bites sandwich) Nom nom nom...