Your post got my quick attention, what with me being a fellow dog owner. Needless to say, a bottle retriever might just be a valuable companion to a bottle collector! Just need to train the dog to the rare ones :-)
This is an unusual shape for bottles of its type, at least to me since I have only seen round vials. The aluminum closure gives it away - it once had a rubber gasket through which a needle could be inserted. It is a medicine vial for an injectable drug of some sort. Mid 20th century, I am not entirely sure.
You will find other examples in this forum by searching on "vial" or "ampule"