This is the principle behind positive displacement pumps, like the manual water pump for example