There is more than one version of the story behind the TENGU depicted riding a white fox (probably linked to Dakiniten-Benzaiten) One version is that the tengu is Dōryō Daigongen 道了大権現. Dōryō was a mountain ascetic before becoming a Soto Zen monk. He was eventually appointed as head cook and administrator at Daiyūzan Temple 大雄山 (Kanagawa Prefecture). After his death in 1411 AD, legend says he metamorphosed into a TENGU goblin and became the monastery guardian. According to scholar Duncan Williams in The Other Side of Zen: A Social History of Soto Zen Buddhism in Tokugawa Japan (published 2005, ISBN 0-691-11928-7): “[Upon his death] his body was engulfed in flames as he appeared transformed and stood on a white fox to promise a life free from illness and full of riches for those who sincerely worshipped him.”
The other version is that the tengu is Akiba Daigongon Tengu Akihabara, Akibasan Sanshakubō 秋葉山三尺坊, Akiba Gongen, Sanshaku Gongen, Sanjakubō
In the 17th century, Tokugawa Ieyasu was appointed to SHOGUN. He brought Akiba Daigongen shrine from his hometown over here. People called this place Akihabara since this event. Akiba Daigongen is a deity who resembles a raven-like Tengu and who rides on fox. He is in charge of fire prevention. During the Edo period in Japan, fire often brought tragedy, because traditionally wooden buildings are many. So, after the Shogun brought Akiba Daigongen from his hometown Akiba Daigongen continued to be venerated by successive Shoguns.
Source: Onmark Productions’ Tengu pages