When you do a factory reset of your device, it will remove the MDM profile from the device. However, it is possible for an MDM provider to still have data on your device even after a factory reset. This is because when you connect to a new Wi-Fi network or sign into a new account, the MDM provider can re-enroll your device and put the MDM profile back on your device.