Yes, but when it comes to code maintenance in bigger projects, being unique for the sake of being unique is not going to help.
There are use cases, however, that involve elements that are tagged for Javascript access later.
For example, in Bootstrap we have [data-toggle="buttons"] on button groups that would hide underlying radio buttons and checkboxes. Javascript will identify the said data attribute and insert toggling ability to the buttons.
That, is a proper use case with a purpose :)