There is no law for volume conservation when dissolving a compound in another.
If "hetero-intermolecular" bonds are tighter than the weighted average of "homo-intermolecular" bonds, it leads to the overall volume contraction when they get dissolved. The same occurs for homo/hetero-intermolecular bond strengths and the energy outcome of mixing.
Analogical effects occur for ion-ion and ion-dipole interactions for ionic compounds being dissolved or formed.
Typical cases are dissolution of strong acids and alkali hydroxides. Another case is dissolution of ethanol and water.