Magnesium oxide dissolving in distilled water
All of that is true, these facts do not contradict each other. 

The missed part is quantification. Salts and generally ion compounds are soluble, but solubility comes in range of many orders of magnitude. 

Also, some compounds, even if largely ionic, react with water.

So magnesium oxide reacts with water forming magnesium hydroxide, both being almost insoluble in water.

Oxide anion  as a very strong Lewis base immediatelly reacts with water $\ce{O^2- + H2O -&gt; 2 OH-}$. So the only chance for metal oxides to stay being oxides is to be insoluble, with their lattice energy too high to be broken by water hydration of ions.