This study presents a modified cylindrical shell theory to predict the critical lateral buckling of both nanotubes and nanorings under uniform external pressure. To this end, nonlocal elasticity theory is incorporated into Donnell's cylindrical shell model and closed-form critical lateral buckling solutions for different nanotubes and nanorings are derived from the coupled displacement equations. In this regard, a novel method is presented for decoupling the displacement equations to facilitate the derivation of the equations and results. Also, the effects of nonlocal parameter, aspect ratio, and mode numbers are investigated for lateral buckling of short and long nanotubes as well as nanorings. Results show that increasing the nonlocal effects, aspect ratio, and mode numbers of the nanotubes can reduce the value of the critical lateral pressure. Finally, the numerical results are compared with existing literature and show good agreement. The results of the new model are more accurate to capture the size effects for nanotubes and nanorings. These findings are useful for designing nanoscale devices.