Cancers caused by germline pathogenic variants are called inherited or hereditary. More than 50 different hereditary cancer syndromes have been identified that can be passed from one generation to the next e.g. Lynch Syndrome
https://voice.ons.org/news-and-views/germline-and-somatic-variants-what-is-the-difference