Many different .chm files exists, but it is likely that at least some of them can be exported and saved as PDF documents. This is typically the case for documents or graphics files and is usually done with the print or dedicated PDF export function.
Ebooks were in the past occasionally distributed compiled HTML format and these can be exported and saved in PDF, including the table of contents.