@bond-3854 Currently Intune SDK does not have such option to extract the device ID from the deployed managed app itself. Can you help us with your use case and scenario for achieving this, may be we can find a different way if possible.
Normally a Device which is enrolled to intune by any user using company portal, has an inventory of that device. If you have device serial number, may be you can incorporate a functionality in app to search for enrolled devices with that user info in app and filter using serial number to get the intune device id, but this will be a long route. Your use case might help us figure out different route. Thanks.
If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.