We calculate the cross section of inclusive dijet photoproduction in ultraperipheral collisions (UPCs) of heavy ions at the CERN Large Hadron Collider using next-to-leading order perturbative QCD and demonstrate that it provides a good description of the ATLAS data. We study the role of this data in constraining nuclear parton distribution functions (nPDFs) using the Bayesian reweighting technique and find that it can reduce current uncertainties of nPDFs at small $x$ by a factor of 2. We also make predictions for diffractive dijet photoproduction in UPCs and examine its potential to shed light on the disputed mechanism of QCD factorization breaking in diffraction.