Is it possible to build caves in the unity terrain?

If so, how do you do it?

No. The terrain is basically just a grid where you can alter the height of every grid point.
For caves you would need to build them out of Meshes and place on the Terrain.

If you’re looking for a voxel-based solution, check the asset store