We have performed a systematic ab initio study on alkali and alkaline earth hydroxide neutral (MOH) and anionic (MOH − ) species where M = Li, Na, K, Rb, Cs or Be, Mg, Ca, Sr, Ba. The CCSD(T) method using extended basis sets and MDF electron core potentials as been used to study their equilibrium geometries, interaction energies, adiabatic electron affinities and potential energy surfaces. All neutral and anionic species exhibit a linear shape with the exception of BeOH, BeOH − and MgOH − , for which the equilibrium structure is bent. In the context of sympathetic cooling of OH − by collision with ultracold alkali and alkaline earth atoms, we investigate the M-OH − potential energy surfaces and the associative detachment reaction M+OH − → MOH+e − , which is the only energetically allowed reactive channel in the cold regime. We discuss the implication for the sympathetic cooling of OH − and conclude than Li and K are the best candidates for ultracold buffer gas.