If you need to generate a UUID, you can use the RandomHash action from the Community Commons module in the Marketplace.
There are various ways to solve this issue.
One way would be to have a string attribute and use the Java Action in CommunityCommons to generate an random hash for you. You would still need to check the uniqueness of it though.
Alternatively, each Mendix object has an ID (of type Long) that is unique per object. You can not directly access it, however you can use the Java Action in CommunityCommons call 'getGUID' to obtain this ID. This ID is generated by the Mendix process.
Hope it helps!