There's no real way to prove the wine barrel part but it's safe to assume he probably sheltered somewhere when it rained. Wine barrels were common and waterproof, so I would assume Diogenes watched a stray dog take shelter in an empty wine barrel and did the same based on his praise of dogs living by instinct combined with the simple practicality of finding shelter rather than making or paying for it.