In this work, we study the effect of diffusion of ultra-high energy cosmic ray (UHECR) protons in the presence of turbulent magnetic fields (TMFs) in the light of the f(R) theory of gravity. The f(R) theory of gravity is a successful modified theory of gravity in explaining the various aspects of the observable Universe including its current state of expansion. For this work, we consider two most studied f(R) gravity models, viz., the power-law model and the Starobinsky model. With these two models, we study the diffusive character of the propagation of UHECR protons in terms of their density enhancement. The density enhancement is a measure of how the density of CRs changes due to their diffusion in the intergalactic medium and interaction with the cosmic microwave background (CMB) radiation. Ankle, instep and Greisen–Zatsepin–Kuzmin (GZK) cutoff are all spectrum characteristics that extragalactic UHECRs acquire when they propagate through the CMB. We analyse all these characteristics through the diffusive flux as well as its modification factor. Model dependence of the modification factor is minimal compared to the diffusive flux. We compare the UHECR proton spectra calculated for the considered f(R) gravity models with the available data of the Telescope Array (TA) and Pierre Auger Observatory (PAO). We see that both models of f(R) gravity predict energy spectra of UHECRs with all experimentally observed features, which lay well within the range of combined data of both experiments throughout the energy range of concern. It is to be noted that our present work is only to investigate the possible effects of f(R) gravity theory on the UHECRs propagation, using pure proton composition as a simplified case study since protons are least affected by magnetic fields. Hence, at this stage, our results cannot be used to favor or disfavor f(R) cosmology over Λ\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$\\Lambda $$\\end{document}CDM cosmology as more work is needed in this regard.