If the device is enrolled with MDM, it has to be Deprovisioned before being Eliminated from the Server. On the MDM console, open the Enrollment tab and click on the Ellipsis Button under the Action column, adapting to the device to be removed from management. Now, click on Deprovision. The device will be moved to the Staged tab from where it can be deleted using the Remove Device choice. If the device is offline or if it has already prevailed unmanaged,  it can be promptly removed from the MDM server.