In this study, dendritic carbon nanofibers (CNFs) loaded with Pd12Ag1 nanoalloy were prepared as a catalyst using a one-pot method. The average particle size of the Pd12Ag1 nanoalloy is 4.2 nm, which is uniformly dispersed over the surface of the CNFs. The Pd12Ag1/CNFs catalyst has the best performance for formic acid oxidation (FAO), with catalytic activity (2825.0 mA mgPd−1) and durability after 7200 s (70.6 mA mgPd−1) up to 5.25 and 10.87 times, respectively, compared with commercial Pd/C. The improved electrocatalytic performance of the Pd12Ag1/CNFs catalyst is attributed to the appropriate Ag doping, which changes the electronic state around the Pd atom, forming two new active sites (Pd-Pd and Pd-Ag); on the other hand, the special structure and rough surface of CNFs expose more active sites to enhance the dehydrogenation process of FAO. Furthermore, Pd13, Ag13, and Pd12Ag1 clusters loaded on the surface of defect-free graphene (DG) and single vacancy defective graphene (SVG) were simulated using density functional theory (DFT) to confirm the effect of different carbon materials and doped metals on the overall catalyst at the atomic level.