The invention discloses a bifunctional oxygen electrocatalyst and a preparation method and application thereof. The catalyst is A1-x-yBxCyO2, the element A is selected from one of Pt, Ir, Ru and Pd, the element B and the element C are selected from Mo, Mn, Fe, Co, Ni, Cu and Zn, and optionally, the element B is the same as the element C. The catalyst is prepared by taking chitosan, cane sugar, fructose, glucose, maltose and the like as templates, taking thiourea, ammonium chloride, urea, ammonium sulfate and the like as gas generating agents to obtain metal salt loaded three-dimensional foam, and conducting calcining. The preparation method provided by the invention has the characteristics of being simple, convenient, efficient, low in cost, environment-friendly and the like, and the obtained catalyst has very excellent electro-catalytic oxygen reduction (ORR) and oxygen evolution (OER) performance and also shows excellent performance in a zinc-air battery.