Short answer: almost always. Wine works as a gift more often than people credit, mostly because you don't need to guess someone's exact taste in home goods or clothing, just a general sense of what they drink, or a bottle nice enough that it doesn't matter.
A housewarming is low-stakes: bring a pinot noir or an easy red blend, the kind of bottle that works whether they open it that night or save it for their first dinner party. When someone gets a promotion, spend a little more intentionally: a Napa Cabernet or solid Bordeaux says "I noticed" better than a card. For weddings and anniversaries, a vintage Champagne from the couple's wedding year becomes a real ritual, opened every year until it runs out. Holiday gatherings call for a Zinfandel or peppery Syrah in winter, rosé and Sauvignon Blanc in summer. And for a simple thank-you, skip the fanciest bottle in the shop: one that actually fits the person usually matters more than the price tag.
Wine also has an advantage most gifts don't: it disappears. No leftover clutter, no regifting awkwardness a year later, just a bottle, an evening, and whatever conversation happens around it.