We present the theory of tunneling ionization of molecules with both electronic and nuclear motion treated quantum mechanically. The theory provides partial rates for ionization into the different final states of the molecular ion, including both bound vibrational and dissociative channels. The exact results obtained for a one-dimensional model of H2 and D2 are compared with two approximate approaches, the weak-field asymptotic theory and the Born-Oppenheimer approximation. The validity ranges and compatibility of the approaches are identified formally and illustrated by the calculations. The results quantify that at typical field strengths considered in strong-field physics, it is several orders of magnitude more likely to ionize into bound vibrational ionic channels than into the dissociative channel.