Yes, it is possible to block the removal of the MDM profile from your Mac devices. If a Mac device is enrolled via the Apple Device Enrollment Program, the administrator can disallow the removal of the MDM profile.
On the DEP policy (Admin->Apple Business/School Manager->Apple DEP->DEP Policy), there is an option to ‘Allow MDM profile removal’. Disabling this option will help you prevent the MDM profile removal. This policy on being applied to the enrolling device will make the MDM profile non-removable.
Please navigate to Windows–>Restrictions–>Allow security and privacy settings. Below will be listed the ‘Manual MDM administration removal’ option.
Uncheck this to restrict the user from deleting the workplace account from the device settings.
PS: If the device is joined to Azure AD as well, disabling this option will have no effect.
Please use the link for insights into the restrictions for Windows devices.