S/N aren't guaranteed to be unique. But as different manufacturers use different schemes for generation of S/Ns, they are mostly unique. Also there aren't any reasons for manufacturers to make two or more HDDs with one S/N. I can say that if they do so it will make warranty returns very difficult. How they will distiungish different devices? It is purpose of S/N.
collisions are really unlikely in practice
There are some cases when software is bounded to HDD model and S/N. When HDD becomes broken, it gives a lot of pain to reconfigure all system. In such case there is option to make full duplicate of old HDD. It needs special software and/or hardware to rewrite serial number and model in HDD, but it is possible. And it can save a lot of time and/or money.
Also when people want to install bigger HDD in their game consoles XBOX, they buy cheaper common HDDs in market and then tune these HDDs to fit XBOX by special software. This program rewrites model, S/N and some hidden information of HDD, so XBOX "thinks" that HDD is original from console vendor. Look for instruction here.
If you really want to get unique ID of HDD, try to dig into SAS protocol specification and specifications of HDDs with such interface. You will find interesting thing
In SAS, device and port names are worldwide unique names within a transport protocol. Port identifiers are the values by
which ports are identified within a domain, and are used as SAS addresses. Phy identifiers are unique within a device.
Also from here
Each SAS port in a SAS domain has a SCSI port identifier that identifies the port uniquely within the SAS domain. It is assigned by the device manufacturer, like an Ethernet device's MAC address, and is typically world-wide unique as well. SAS devices use these port identifiers to address communications to each other.
You can read these IDs and use them to distiungish devices.