I did not yet come across a device which does that (in an easy to recognize way*) but in theory they could. And in practice they sometimes do.
In the end a harddrive is a cpu (often an ARM processor) + ram (cache) + bios/bootloader (on the CPU itself or the NAND or some other chip) + lots of attached storage (not everything of that being visible to the average end user)
Something like a stripped down Raspberry Pi, just with a dumb OS.
For external devices you often have an additional cpu+eeprom for the USB side of the device.
The dumb OS normally only does stuff relevant for doing storage things.
But even at that level it at least needs to know what data is going through the dumb OS so in principle it sees that which could just belong to this Computer.
If it saves that is a different question.
Some skilled person could install a not so dumb OS to save more data about what the device is doing. This has actually been happening since quite a while (look up HDD/USB firmware malware)
Just overwriting from the OS side won't help you in these special cases.
*
I do have an USB SATA adapter which inside the firmware keeps track of the "other" side (i.e. names of HDD's attached to it). Some other adapter also seems to flip some bit when it is attached to something. I also have a HDD which after a while changes dozens of lines in the firmware, could be normal logging or maybe saving stuff like bad sectors or maybe saving my nuclear launch codes.