A theory of dispersionless Andreev bound states on surfaces of time-reversal invariant unconventional superconductors is presented. The generalized criterion for the dispersionless Andreev bound state is derived from the bulk-edge correspondence, and the chiral spin structure of the dispersionless Andreev bound states is argued from which the Andreev bound state is stabilized.Then we summarize the criterion in a form of index theorems. The index theorems are proved in a general framework to certify the bulk-edge correspondence. As concrete examples, we discuss (i) d xy -wave superconductor (ii) p x -wave superconductor, and (iii) noncentrosymmetric superconductors. In the last example, we find a peculiar time-reversal invariant Majorana fermion. The time-reversal invariant Majorana fermion shows an unusual response to the Zeeman magnetic field, which can be used to identify it experimentally.