Like dissolves like. A polar substance will not dissolves a non polar substance. In the case of oil and vinegar, the vinegar is polar and more dense than the oil, so it settles on the bottom of the container. The oil is non polar and less dense, so it doesn’t dissolve in the vinegar, and it floats on.