Aim Previous studies have provided evidence that primary site surgery can improve the prognosis of rectal cancer patients, even in those with advanced age and distant metastasis, though results have been inconsistent. The current study aims to determine if all rectal cancer patients are likely to benefit from surgery in terms of overall survival. Methods This study examined the impact of primary site surgery on the prognosis of rectal cancer patients diagnosed between 2010 and 2019 using multivariable Cox regression analysis. The study also stratified patients by age group, M stage, chemotherapy, radiotherapy, and number of distant metastatic organs. The propensity score matching method was used to balance observed covariates between patients who received and did not receive surgery. The Kaplan–Meier method was used to analyze the data, and the log-rank test was used to determine differences between patients who did and did not undergo surgery. Results The study included 76,941 rectal cancer patients, with a median survival of 81.0 months (95% CI: 79.2–82.8 months). Of these patients, 52,360 (68.1%) received primary site surgery, and they tended to be younger, have higher differentiated grade, earlier T, N, M stage, and lower rates of bone, brain, lung, and liver metastasis, chemotherapy, and radiotherapy than those without surgery. Multivariable Cox regression analysis revealed that surgery had a protective effect on the prognosis of rectal cancer patients, including those with advanced age, distant metastasis, and multiple organ metastasis, but not in patients with four organ metastases. The results were also confirmed using propensity score matching. Conclusion Not all rectal cancer patients could benefit from the surgery on the primary site, especially the patients with more than four distant metastases. The results could help the clinicians to tailor targeted treatment regimens and provide a guideline for making surgical decisions.