A Poincare-Wirtinger inequality holds over a domain $\Omega \subseteq \mathbb R^n$ with exponentnt $1 \leq p \leq \infty$ if there exists $C(p,\Omega) > 0$ such that
$\| u - \operatorname{avg}(u) \|_{L^p(\Omega)} \leq C \| \nabla u \|_{L^p(\Omega)}$
for every $u \in L^p(\Omega)$. We have written $\operatorname{avg}(u)$ for the average of $u$ over the domain $\Omega$.
For which domains does such an inequality hold, with possible dependence on $p$? I expect the answer to be dependent on that integrability exponent.
The statement is true for bounded Lipschitz domains, as one may easily find in the literature. I am wondering what are necessary and sufficient conditions.
EDIT: If you think no such conditions are known, I am interested in domains which do not support such an inequality.