When the potential of vector field can be found integrating on segments parallel to the coordinate axes? A simple method to find the potential of a conservative vector field defined on a domain $D$ is to calculate the integral 
$$U(x,y,z)=\int_{\gamma} F \cdot ds$$
On a curve $\gamma$ that is made of segments parallel to the coordinate axes, that start from a chosen point $(x_0,y_0,z_0)$.
I would like to know what are precisely the restrictions on $D$ for this method.  $D$ should be made in such way that "any point can be connected to $(x_0,y_0,z_0)$ with, indeed, a segment parallel to the coordinate axes".
But what are the sufficient mathematical conditions for $D$ in order to have this property?
I would say that it surely has to be connected, but that seems not to be enough. For example taking
$$D= \{ (x,y) : y>x-1\} \,\,\,\, \,\,\,\,\,(x_0,y_0)=(0,0)$$
$D$ is connected but I do not think that any point can be connected to $(0,0)$  via a segment parallel to the coordinate axes.

Edit (for @EmilioNovati answer):

 A: Hint:
the curve $\gamma$  is 

made of segments (not necessarily one) parallel to the coordinate axes.  

This means the we can have two (or more) consecutive segments parallel to the coordinate axis that connect a point to the origin.
The figure gives an example for a point $A$ in the region $D$ that can be connected to the origin by the two segments $u$ and $v$.

A: First of all we convert the question in a convenient formalization using simple affine transformation of the space $\Bbb R^n\supset D$ (here as $n$ I assume any natural number). First, by shifts along coordinate axis we move the chosen point $r_0\in\Bbb R^n$ into the origin $(0,0,\dots,0)$. As I understand, the order of directions of segments of a path from $r_0$ to a point $r=(x_1,\dots,x_n)\in D$ is fixed, so, after a permutation of the coordinate axis, we may consider it as $(1,2,\dots,n)$, that is first we should walk along the first coordinate, then along the second,... and, at last, along the last. Also when we fix the order of directions of segments of a path from the point $r_0$ to a point $r$, the path becomes unique:  
$$(0,0,0,\dots,0)\to (x_1,0,0,\dots,0)\to (x_1,x_2,0,\dots, 0)\to \dots\to (x_1,x_2,x_3,\dots, x_n).$$
Such a path from $r_0$ to $r$ we shall call a right path. We shall call the domain $D$ with the fixed origin $r_0$ right path connected, if for each point $r\in D$ the right path from the point $r_0$ to the point $r$ is contained in $D$. The structure of right paths yield us the following recursive characterization of right path connected domains. 
For each $1\le k\le n$ let $\pi_k:\Bbb R^n\to \Bbb R^n$ be a projection onto first $k$-coordinates (for instance, $\pi_2(x_1,x_2,x_3,\dots, x_n)=(x_1, x_2,0,\dots,0)$ and let $D_k=\pi_k(D)$. For the convenience we assume that $D_0=\{r_0\}$ and $\pi_0$ maps the space $\Bbb R^n$ into the point $0\in\Bbb R^n$. The domain $D$ is right path connected iff for each $0\le k\le n-1$,  for each point $r\in D_{k+1}$ and the segment $[\pi_{k}(r),r]$ between the points $\pi_{k}(r)$ and $r$ belongs to $D_{k+1}$. 
Corollary. There is no point $r_0\in\Bbb R^2$ and an order of directions of segments of a path from $r_0$ to a point in the domain $D= \{ (x,y) : y>x-1\}$ which makes it right path connected,  because for each line $\ell\subset\Bbb R^2$ which is parallel to a  coordinate axis the projection of $D$ onto $\ell$ along the other axis is not contained in the intersection of $D\cap\ell$.
A generic example of a right path connected domain for two dimensional case is $$D=\{(x,y)\in\Bbb R^2: a\le x\le b, l(x)\le y\le u(x)\},$$ where $a<0<b$ are constants and $l$ [$u$] is a non-positive [non-negative] function from $[a,b]$ to $\Bbb R$. 
I remark that you didn’t specify what is a domain. Usually a domain is an open set or a closure of an open set. It both cases, $U\subset D\subset\overline{U}$ for some open set $U\subset\Bbb R^n$. I am trying to explicitate this condition for 
right path connected set $D$, in terms of (semi) continuity of the functions $l$ and $u$, similarly as I did it in this answer, so there may be an update later. 
