MgCl2 is an ionic compound. Thus it can easily dissolve in polar solvents like water (like dissolves like). On the other hand it does not dissolve in a non-polar solvent like acetone.
Methane (CH4 ) is a non-polar covalent compound. Thus it does not dissolve in polar solvents like water. On the other hand, it can easily dissolves in non-polar solvents like acetone.