Since,
The two substances having different mass can have different volumes only in the case when the two substances have different densities.
Similarly, the two substances having same volume can have different mass, again if the two substances have different values of densities.