Linear and nonlinear optical properties of low-dimensional nanostructures have attracted great interest from the scientific community as tools to probe the strong confinement of electrons and for possible applications in optoelectronic devices. In particular it has been shown that the linear optical response of carbon nanotubes [F. Wang et al., Science 308, 838 (2005)] and graphene nanoribbons [Nat. Commun. 5 4253 (2014)] is dominated by bounded electron-hole pairs, excitons. The role of excitons in linear response has been widely studied, but still, little is known about their effect on nonlinear susceptibilities. Using a recently developed methodology [Phys. Rev. B 88, 235113 (2013)] based on well-established ab initio many-body perturbation theory approaches, we find that quasiparticle shifts and excitonic effects significantly modify the third-harmonic generation in carbon nanotubes and graphene nanoribbons. For both systems the net effect of many-body effects is to reduce the intensity of the main peak in the independent-particle spectrum and redistribute the spectral weight among several excitonic resonances.