This question has been asked many times when the stack overflows.
In short: Android has always supported a unique identifier. However, prior to Android 2.2, the identifier was not always identical for some types of phones. Since 2.2 is pretty common, I would use this identifier.
The Android Developer blog has a good article on this.
And, as Joachim said, you can generally consider a different approach. Android's unique identifier is good and persistent with the factory reset, but not through a device update. Also keep in mind that many people have multiple devices (such as a phone and tablet). Instead, you can use a Google account, AccountManager can help you.
EboMike
source share