Hi,
As stated in the README.md at mshr:
mshr is the mesh generation component of FEniCS. It generates simplicial DOLFIN meshes in 2D and 3D from geometries described by Constructive Solid Geometry (CSG) or from surface files, utilizing CGAL and Tetgen as mesh generation backends.
Therefore, I suggest looking into these two backends for details.
You could consider using external meshing software, such as gmsh to generate the meshes, and meshio to transfer the meshes to a readable format for FEniCS, see Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio for a detailed description of how to do this transformation.