The linear theory of heat waves is generalized to nonlinear situations in a conservation-dissipation formalism in the context of extended thermodynamics. An analogy with the theory of nonlinear electromagnetic waves is pointed out. This analogy emphasizes several physical aspects of the nonlinear theory and allows a parallelism with nonlinear optics, which may be of interest in nonlinear phononics. The proposed nonlinear equation for heat waves is compared with nonlinear transport equations in other fields of non-equilibrium thermodynamics, and it is applied to second-harmonic generation of heat waves in graded materials