The King of Brahmas called Arsi, lost a wager to the King of Devas, Śakra (Thagya Min), who decapitated Arsi as agreed but put the head of an elephant on the Brahma's body who then became Ganesha [REF].
In Thailand, Ganesha is called Phra Phikanet (พระพิฆเนศ) or Phra Phikanesuan (พระพิฆเนศวร) and is worshipped as the deity of fortune and success, and the remover of obstacles.