We have performed semiempirical (MNDO) as well as ab initio density-functional theory calculations at $T=0$ to analyze the hydrogen storage behavior in spheroidal ${\mathrm{C}}_{60}$ and ${\mathrm{C}}_{82},$ and cylindrical finite-length (5,5) armchair C and BN fullerenes. We have found that, while chemisorption of individual H atoms to the external surface of the fullerenes is observed, hydrogen atoms cannot be attached to the inner wall of the structures and can only exist in a molecular form inside the fullerenes. We further find that, as a function of the symmetry of the encapsulating cavity and a delicate balance between repulsive energies among ${\mathrm{H}}_{2}$ molecules inside the structures and those between ${\mathrm{H}}_{2}$ molecules and the fullerene walls, molecular $({\mathrm{H}}_{2}{)}_{N}$ clusters of well defined shape are formed namely: linear configurations, two-dimensional zig-zag and triangular arrays, and three-dimensional structures such as octahedral and icosahedral clusters, as well as helicoidal cylindrical-shape assemblies. In the cylindrical configurations (C and BN tubes), hydrogen atoms are placed inside the structures up to a bond breakage of the fullerene network, which allow us to estimate the maximum storage capacities of the different configurations. Actually, in our closed nanotubes, we relate the bond breakage mechanism to the development of a nonuniform hydrogen accommodation along the tubes, driven by the both highly anisotropic ${\mathrm{H}}_{2}\ensuremath{-}{\mathrm{H}}_{2}$ and wall-${\mathrm{H}}_{2}$ repulsive interactions. With increasing the number of stored ${\mathrm{H}}_{2},$ tubes are found to be mainly radially deformed, a fact that reduces (up to $\ensuremath{\sim}13%)$ the energy difference between the highest occupied and lowest unoccupied molecular orbitals in the structures. Finally, saturation of the tube ends with molecular terminations results in stable compounds from which a density-controlled storage of hydrogen seems to be possible.