Let me answer to the local solvability question in the $C^\infty$ category. Take a complex-valued vector field $Z=X+iY, X,Y$ real-valued vector fields such that $Z$ is always non-zero (a "principal-type" condition). There are some terrible pathologies for some very simple examples as the Hans Lewy vector field in $\mathbb R^3$,
$$
\mathcal L=\partial_{x_1}+i\partial_{x_2}+i(x_1+ix_2)\partial_{x_3}.
$$
For "most" functions $f$ (in the Baire category sense), the equation $\mathcal Lv=f$ does not have a distribution solution, even locally.
There is an iff local solvability condition for these principal type vector fields $Z$, the so-called Nirenberg-Treves condition $(P )$. It is not so easy to write it down in general but the following case is a significant illustration: take in $\mathbb R^2$,
$$
Z=\partial_{x_1}+ib(x_1, x_2)\partial_{x_2}.
$$
Then $Z$ is locally solvable near $0\in \mathbb R^2$ iff there exists a neighborhood of $0\in \mathbb R^2$ such that
$$
x_1\mapsto b(x_1, x_2) \text{ does not change sign for any given $x_2$ near 0.}
$$
It turns out that this condition has an invariant expression.
Simple examples of non-locally solvable operators are
$$
\partial_{x_1}\pm ix_1\partial_{x_2},\quad \partial_{x_1}\pm ix_1^{2k+1}\partial_{x_2},
\quad\text{since $x_1^{2k+1}$ changes sign at $0$,}
$$
and simple examples of locally solvable operators are
$$
\partial_{x_1}\pm i\partial_{x_2},\quad, \partial_{x_1}\pm ix_1^{2}\partial_{x_2},\quad \partial_{x_1}\pm ix_1^{2k}\partial_{x_2},
\quad\text{since $x_1^{2k}$ does not change sign.}
$$