It is from the Sunnah that when you enter the mosque you begin with your right foot, and when you leave you begin with your left foot.
من السنة إذا دخلت المسجد تبدأ برجلك اليمنى، وإذا خرجت أن تبدأ برجلك اليسرى.
No references are available.
Hakim narrated it (1/218) - and from him Bayhaqi in al-Kubra (2/442) - from Abu Hafs Umar bin Jafar, who said, Abu Khalifa the judge narrated to us, who said, Abu Walid Tayalisi narrated to us, who said, Shaddad Abu Talha narrated to us, saying, I heard Muawiya bin Qurra narrating from Anas bin Malik, and he mentioned it.Ibn Umar used to begin with his right foot, and when he left he began with his left foot. Bukhari mentioned this in the Book of Prayer, in the chapter on beginning with the right foot when entering the masjid and elsewhere. Ibn Hajar said, "I have not seen it connected from him."