And for many years now, long before 2005, Apple removed the ability to request the UDID of a phone, and didn't allow anyone on the app store who would try to identify your iPhone. So very clearly against the app store rules. And they knew that, so this wouldn't happen if the app was run near Cupertino, where presumably the testers were located who checked for this.
There is a new thing - a device specific identifier for a vendor. That is a unique code identifying your phone _to one application_. And this identifier is destroyed when you delete the application. So various vendors cannot identify whether you used two or three of their applications, because the vender identifiers are different, and they can't keep track of anything when you delete the app.