How to load 3D hexahedron mesh file and set the boundaries

You shouldn’t import dolfinx or use anything from dolfinx in combination with legacy FEniCS. For usage of dolfinx, see:
https://jsdokken.com/dolfinx-tutorial/
and