We theoretically characterize interactions, energetics, and chemical reaction paths in ionic twobody and three-body systems of alkali-metal and alkaline-earth-metal atoms in the context of modern experiments with cold hybrid ion-atom mixtures. Using ab initio techniques of quantum chemistry such as the coupled-cluster method, we calculate ground-state electronic properties of all diatomic AB + and most of triatomic A2B + molecular ions consisting of Li, Na, K, Rb, Cs, Mg, Ca, Sr, Ba, and Yb atoms. Different geometries and wave-function symmetries of the ground state are found for different classes of molecular ions. We analyze intermolecular interactions in the investigated systems including additive two-body and nonadditive three-body ones. As an example we provide twodimensional interaction potential energy surfaces for KRb + +K and Rb + +Sr2 mixtures. We identify possible channels of chemical reactions based on the energetics of the reactants. The present results may be useful for investigating controlled chemical reactions and other applications of molecular ions formed in cold hybrid ion-atom systems.