The invention provides a preparation and an application of a nitrogen, sulphur or chlorine-doped three-dimensional porous graphene catalyst. The preparation comprises the following steps: dissolving graphene oxide, an alkyl compound, a transition metal salt containing nitrogen, sulphur or chlorine and hydrochloric acid into a solvent, and carrying out ultrasonic treatment and drying to obtain a precursor; heating the precursor to 600-1,000 DEG C under inert gas protection and carrying out roasting reduction treatment for 1-3 hours to obtain primary carbide; carrying out pickling treatment on the obtained primary carbide with a mixed solution of hydrofluoric acid and hydrochloric acid at a room temperature for 12-24 hours, centrifuging the primary carbide, cleaning the primary carbide with deionized water and then drying the primary carbide to obtain the three-dimensional porous graphene material containing nitrogen, sulphur or chlorine; and heating the three-dimensional porous graphene material to 600-1,000 DEG C under inert gas protection, and carrying out roasting reduction treatment for 1-3 hours to obtain the nitrogen, sulphur or chlorine-doped three-dimensional porous graphene catalyst. The nitrogen, sulphur or chlorine-doped three-dimensional porous graphene catalyst has the characteristics of being high in stability, not easy to poison and the like, and has a good application prospect in the fields of wastewater treatment of a fuel cell, a metal-air cell, a super capacitor, an energy storage battery and a microbial fuel cell and the like.