As long as you're not forced to use the cancer that is Android or iOS.. Then it's ok.. Otherwise that should be illegal.
The electronic ID needed to access public services, etc. works best on Android or iOS, though there are macOS and MS Windows options.