When I try to extrude dxf files that I have imported from adobe illustrator, they extrude but there is also a rectangular panel attached to the extruded shape
You can delete that "rectangular panel", it represents the boundary of the sheet / artboard in Illustrator with a specific size, e.g. A4 - A3 etc. on which the original drawing was created,