Is maximum principle valid in the case of non-smooth boundaries? Let $U_1$ and $U_2$ be two bounded domains in $\mathbb{R}^n$ such that $U_1 \Subset U_2$. Note that we don't assume $\partial U_i$ to be smooth
or Lipschitz, they may be very bad.
Denote $U=U_2 \backslash \bar{U_1}$, consider the Dirichlet problem
\begin{equation}
\Delta u=0 \text{ on }U,
\end{equation}
\begin{equation}
u=1 \text{ on } \partial U_1, \quad u=0 \text{ on } \partial U_2.
\end{equation}
Let
$$
U^r_1=\{x \in \mathbb{R}^n: d(x,U_1)\leqslant r\},
$$
$$
g_r=\max\{ 1-\frac{d(x,U_1)}{r}, 0\},
$$
an extension from $1,0$ function to a Lipschitz function defined on $\bar{U}$. By the standard argument, we can prove that there exists a
function $u \in W^{1,2}(U)$ satisfying the above boundary value problem and $u-g_r \in W^{1,2}_0(U)$. For different $r$ and different extensions, the solutions remain
unchanged, i.e. the solution is unique.
Now suppose $U_2 \Subset U_3$, consider the Dirichlet problem
\begin{equation}
\Delta v=0 \text{ on } U_3 \backslash \bar{U}_1,
\end{equation}
\begin{equation}
v=1 \text{ on } \partial U_1, \quad v=0 \text{ on } \partial U_3.
\end{equation}
Do we have $v\geqslant u$ on $U$?
If $\partial U_i$ are smooth for $i=1,2,3$, then $u\in C(\bar{U})$, $v\in C(\bar{U_3} \backslash U_1)$. $u, v|_{\partial U_1}=1$, $u|_{\partial U_2}=0$ and
$v|_{\partial U_3}=0$. Then $v-u \geqslant 0$ on $\partial U_1$ and $\partial U_2$, by the maximum principle, we have $v\geqslant u$. However, the boundaries we considered here are not smooth.
 A: Yes, indeed, the maximum principle for subharmonic functions (hence for harmonic functions) is valid for domains, independently of the smoothness of their boundaries :
Let $u$ be a subharmonic function on a domain (i.e. open connected set) $D$ in $\mathbb{C}$ (or $\mathbb{R}^n$), if $\limsup_{z\to\zeta}u(z)\leq 0$ for all $\zeta\in\partial D$, then $u\leq 0$ on $D$,
See e.g. Theorem 2.3.1 in the book by T. Ransford, Potential theory in the complex plane.
Concerning existence (and uniqueness) of a solution to the Dirichlet problem, the following holds true (see Corollary 4.2.6 of the above-mentioned book):
Let $D$ be a domain with non-polar (intuitively not too small) boundary, and let $\phi:\partial D\to\mathbb{R}$ be a bounded function, continuous on $\partial D$. Then there exists a unique bounded harmonic function $h$ on $D$ such that $\lim_{z\to\zeta}h(z)=\phi(\zeta)$ for nearly every $\zeta\in\partial D$ (nearly meaning outside a set of capacity zero). If the domain is regular (with respect to the Dirichlet problem) the limit holds for all $\zeta\in\partial D$. 
