This is a duplicate answer: I can't find @moonboots' original. If found, feel free to delete this one.
- Decide which face you want the object to lie flat on. In Edit Mode, select the face, and create a Custom Orientation from it. (In 2.79, CtrlAltSpace. In 2.8,Header > Orientations dropdown > '+')
- With all the object's vertices selected, CtrlH hook them to a new Empty. They are now frozen, while you transform their local axis.
- In Object Mode with the object to be aligned selected. In menu Header > Object > Transform, click 'Align to Custom Orientation'
- Go to the object's modifier panel, find the Hook modifier, and apply it.
Now the object's local Z axis will be oriented normal to the chosen face, and it will be easy to rotate the object to align it with the world, or, by snapping, to any other face. You could, if you want to, ShiftAltO pt yhe origin to center of the face, too.