The wear behavior and its mechanism greatly depend on the microstructure of alloys. Herein, the Co-18.5 at. % B eutectic alloys with three different morphologies and phase constitutions were obtained by undercooling solidification under different magnetic field intensity (0T, 10T, 20T), and the relative mechanical properties and tribological performance were investigated systematically. Results show that the grain size of Co–B alloy decreases first and then increases with the increase of magnetic field strength, the average grain size of samples under 0 T and 20 T was about 3–5 μm, while the grain size of sample with 10 T refined to 20–40 nm. The sample treated under 10 T exhibits the lowest wear rate (1.53 × 10−5 mm3N−1m−1) and highest micro-hardness (868.27 HV). The fine grain strengthening effect is the main reason for the increase in strength and hardness of Co–B alloy. The fine crystalline nano-heterostructures (20–40 nm) and the precipitation enhancement of secondary precipitated Co nanoparticles also has a beneficial effect on mechanical properties. The oxide friction layer consisting mainly of layered H3BO3 lubricant, detected on the worn surface of Co–B alloy (10T) has anti-wear properties. By contrast, Co–B alloys with coarse Co3B grains (0T) and inhomogeneous FCC-Co/Co2B lamellar structure (20T) present higher wear rates and lower hardness. This work can provide guidance for the initial control of mechanical properties from the design of the microstructure.