We solve the generalized relativistic harmonic oscillator in 1 + 1 dimensions, i.e., including a linear pseudoscalar potential and quadratic scalar and vector potentials which have equal or opposite signs. We consider positive and negative quadratic potentials and discuss in detail their bound-state solutions for fermions and antifermions. The main features of these bound states are the same as the ones of the generalized three-dimensional relativistic harmonic oscillator bound states. The solutions found for zero pseudoscalar potential are related to the spin and pseudospin symmetry of the Dirac equation in 3 + 1 dimensions. We show how the charge conjugation and γ 5 chiral transformations relate the several spectra obtained and find that for massless particles the spin and pseudospin symmetry-related problems have the same spectrum but different spinor solutions. Finally, we establish a relation of the solutions found with single-particle states of nuclei described by relativistic mean-field theories with scalar, vector, and isoscalar tensor interactions and discuss the conditions in which one may have both nucleon and antinucleon bound states.