By the way, even if you do enable preprocessing, you would still need to follow Jackie's advice about Calibre's settings under structure detection/TOC to actually build the Table of Contents. Preprocessing takes those common types of chapter headings I mentioned and wraps them in <h2> tags, but then the structure detection settings must still match how the chapters are defined.
The default rule is this:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter']
With that and preprocessing you would get an automatically generated TOC if your book happened to use Chapter xxx, or one of the other words in that pattern.
You can change that simply follow Jackie's advice to match all h2 headers in structure detection and TOC creation:
I'll often just edit the existing xpath though, to match numbers:
//*[((name()='h1' or name()='h2') and re:test(., '\d+', 'i')) or @class = 'chapter']
//*[((name()='h1' or name()='h2') and re:test(., '.*', 'i')) or @class = 'chapter']
That last one basically does the same as Jackie's suggestion, but all you need to remember is to change the words to '.*' or '\d+'