In the game engine there is an option to constrain rigid body translations and rotations on an axis:
Is it possible to do this with the 3D view rigid body physics system?
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
In blender 2.80 (and likely earlier versions), you can selectively lock translation and rotation axes, limiting physics simulations to your choosing.
Do this in the Transform sidebar (hit N to toggle).
As seen above, both X and Y axis has been locked, forcing simulation to only translate along Z-axis, but otherwise rotate freely.
This can be handy for quickly placing objects using physics. For example: