ECC works only for ram which dlerious states is correct.
Will it work for a external hdd?
Only when your copying or moving data to and from that drive connected directly to the PC with ECC.
Data gets pooled into ram, and then copied onto your drive, so when its pooled and stored in ram, it will make sure the data is error free.
On NAS devices your going to hear a lot of yay, and nae sayers.
On FreeNAS for example, or any FreeBSD based NAS, they say ECC is an absolute must, because of how DB works.
However, there are many that say they have not had 1 problem without ECC, but its your data, how much protection you want on it is totally up to you. You don't need full comprehensive coverage on your auto insurance (example).
Also most NAS's are a computer itself.
Synology, Qnap's and most reputable NAS's are powered by some form of x86/ARM processor and has a network interface card.
They run a small file off internal eMMC flash, or a dedicated sdd.
They do not directly connect to a PC, outside probably initial data migration, since usb3.0 is faster then a straight 1gbe network connection. That is not a definition of NAS... (Network Attached Storage)
Anyhow so to answer your question, if the PC has ECC, and your doing the data migration from that PC with ECC, then yes, your data is being copied with ECC if its directly connected to that PC.
If its a PC with ECC copying data to a NAS without ECC, then no.
The NAS without ECC can theoretically write a error on itself, even tho the PC sending data has ECC.
Your basically looking at the weakest link, there being the NAS without ECC.