Deform Terrain to Object question

So im working on a game that has a large focus on player built content using prefabs. some of these prefabs are things like a trench or building with a basement etc. Is there a way to make it so that when my player builds say a trench, to have the terrain adjust to the prefab item so that the trench is usable, Id like to avoid prefabs being placed on the surface of the terrain if possible.