In this present contribution, tensile mechanical properties of Ni–Co alloy nanowires with Co content from 0 to 20% were studied by molecular dynamics. The simulation results show the alloy nanowire with the Co content of 5% has the highest yield value of 9.72 GPa. In addition, more Frank dislocations were generated during the loading process to improve the performance of the alloy nanowire. The Young's modulus increases little by little from 105.68 to 179.78 GPa with the increase of Co content. Secondly, with the increase of temperature, the yield strength gradually decreases to 2.13 GPa. Young's modulus tends to decrease linearly from 170.7 GPa to 48.21 GPa. At the temperatures of 500 K and 700 K, it is easier to form Frank dislocation and Hirth dislocation, respectively, in the loading process. The peak value of the radial distribution function decreases and the number of peaks decreases, indicating the disappearance of the ordered structure. Finally, after the introduction of the surface and inner void, the yield strength of the nanowire drops about to 8.97 and 6.6 GPa, respectively, and the yield strains drop to 0.056 and 0.043. In the case of the existence of internal void, perfect dislocation and Hirth dislocation can be observed in the structure.