In the electrochemical ammonia oxidation reaction (AOR), the alloying strategy is an effective method to improve the activity of Pt-based catalysts. Nevertheless, its reaction pathway and anti-poisoning mechanisms still need to be studied in detail to improve the understanding. In this study, the OS and GM mechanisms are considered simultaneously to systematically investigate the reaction pathway and anti-poisoning mechanism of Pt and PtM alloys (M = Fe, Co, Ni, Cu, and Zn) by density functional theory. The formation of PtFe, PtCo, PtCu, and PtZn alloys was observed to enhance the kinetics of the AOR. For Pt, PtCo, and PtZn, the GM mechanism is more prevalent in the AOR process due to the lower reaction energy barrier compared to the OS mechanism. Notably, this work demonstrates that the introduction of Fe, Co, Cu, and Zn induces an electronic structure change of Pt atoms, resulting in the weakening of the Pt-N bond and facilitating the desorption of *N and *N2, therefore enhancing the anti-poisoning properties of the OS and GM mechanisms, respectively. This study deepens the understanding of the reaction pathway and anti-poisoning mechanisms of Pt-based alloy catalysts and presents an effective strategy for designing efficient and stable AOR catalysts.