MgCl2 is a electrovalent compound, so it is soluble in water (as water is a polar solvent and has a high dielectric constant) and insoluble in organic solvents like acetone (as organic solvents are non-polar and have low dielectric constant and do not cause dissolution).
Methane is a covalent compound and is insoluble in polar solvents like water and dissolve in organic (non-polar) solvents like acetone.