If you are trying to register your device on your Microsoft account online, the method to add a device to your Microsoft account using a serial number is only available for Microsoft manufactured devices, like a Surface laptop... etc.
For all other devices, ensure you log into the device with your Microsoft account, then ensure the Location Services setting and the 'Find My Device' setting is enabled in the Settings app, your device will then be automatically be added to your Microsoft account, that will not happen immediately, but it will happen eventually.