Apple Server plays no role while you retrieve the UUID from the device by the above method mentioned in your question.
You can check this by creating a hotspot and connect both your phone and the server which serve the .mobileconfig file to the hotspot.
install the provision file on your phone and it will send back the response to the URL mentioned in the .mobileconfig file.
tip: you have to install trust certificate before installing the .mobileconfig file.
solved Get an iPhone UDID from Mobile Safari