dnd 5e – What happens if a vial of acid falls from the sky?

When there is intent to attack by an entity capable of making at attack, you use that creature’s attack. If the entity cannot attack (standard find familiar familiars, mage hand), then it can’t attack.

Aside from that, there are no rules for this sort of thing, and it’s going to be up to the DM; the rules don’t allow it, but there’s tons of things the rules don’t fully cover, and that’s why the DM exists.

In your edge cases like “entity carrying vial killed by another entity (capable of making attacks) with intent to harm those below” I might allow an attack (almost certainly with disadvantage) by the creature that killed the entity to cover them timing and aiming the attack to cause the vial to fall on their “real” target.

But if there’s no intent, and nothing that could conceivably be making an attack, then it’s pure DM whim; this is a mild version of “rocks fall, everybody dies” (“acid falls, maybe someone gets splashed”). There’s no rules. Perhaps you determine the square it would land in, and require the occupant of that square to make a low DC Dex save (probably with advantage to account for lack of guiding intelligence in the attack). These are heroes, they rarely get killed or injured by random chance.