We can completely characterize the subsets of $\mathbb R^n$ that are the boundaries of open sets -- they are the closed, nowhere dense sets!
A set is nowhere dense if it has empty interior. These include
- Graphs of (continuous!) functions
- Level sets of polynomials
- Certain fractals, like the Cantor set
- Loops that don't intersect themselves.
Proof:
Suppose that the set $C=\partial U\subseteq\mathbb R^n$ is the boundary of the open subset $U\subseteq\mathbb R^n$. $C$ is automatically closed (this is true of every boundary). Because $U$ is open, $U\cap C=\varnothing$. Hence $C$ has empty interior.
Conversely, start with a closed, nowhere dense set $C$. Let $U$ denote the complement of $C$, so that $U$ is open. Then $C$ contains $\partial U$ because $\partial U\cap U = \varnothing$. Since $C$ also has empty interior, $C$ is the boundary of $U$ (why?). QED
In conclusion, the boundaries of open sets are the closed, nowhere dense sets. This should hold in any metric space and might even hold in greater generality, but I haven't thought about it.
To get back to your question about how nontrivial the boundaries of an open set can be, the answer is very. There are lots of closed, nowhere dense sets and most of them have no smoothness properties.
(This is an expansion of Ian's comment.)