I have a somewhat slippery desktop, so I like to place an SSD, (or anything that I might have attached to some Mac that I am working on) on an anti-skid pad, so it doesn't drift around while I am using it. Not for any technical issue, but SSDs (particularly the various NVME enclosures that I have) don't weigh much, and I simply want them to stay where I put them.
But, no, an SSD does not care about physical position, upside-down has no meaning with something with no moving parts.
I wouldn't place an HDD upside down, but modern hard drives don't care much either - you don't have to run them precisely flat.
But, I wouldn't turn an HDD over while it is running - the movement i think would cause a bit of coriolis effect, which could affect the disk in some way.