Every sprite has already an unique ID. shortened as UID. You can retrieve it in the expression Sprite.UID
It is unique during run time. It can rearrange during designing, when you going to create/destroy sprites in layout editor.
You can also give a sprite an instance variable. Give it a accumulating value during run time. Or give it values in the layout editor.
Both are intensive used. But not (or very rarely) in the way that you mention.
Using the condition Sprite > 'On collision with another object' will PICK both (instances of) objects, and only those objects.
The actions work on the picked objects.