The definition of topological manifold with boundary

An $n$-manifold with a boundary is a second countable Hausdorff space in which any point has a neighborhood which is homeomorphic to an open subset of $\mathbb H^n = \{x\in \mathbb R^n:x_n\geq 0\}$ endowed with a Euclidean topology.

What I am confused about the definition is that what if there exists a neighborhood $U$ of $p\in X$ s.t. it is homeomorphic both to an open set of $\mathbb{H}^n$ which intersect $\partial\mathbb{H}^n$and an open set which is not.

Or another case what if there exist two neighborhoods $U,V$ of $p\in X$, with one homeomorphic to an open set of $\mathbb{H}^n$ which intersect $\partial\mathbb{H}^n$ and another one not.

This is not possible. If $V \subset \mathbb{H}^n$ and $V' \subset \mathbb{H}^n$ are open and homeomorphic, then either both intersect $\partial \mathbb{H}^n$, or neither of them does.
You can give several proofs of this, for example using relative homology (if $x \in \partial\mathbb{H}^n$ then $H_n(V, V \setminus \{x\}) = 0$, whereas if $x \not\in \partial\mathbb{H}^n$ then $H_n(V, V \setminus \{x\}) = \mathbb{Z}$).
Since you tagged this "differential geometry", here is a proof that uses the inverse function theorem. Suppose that $V \cap \partial\mathbb{H}^n = \varnothing$ while $V \cap \partial\mathbb{H}^n \neq \varnothing$, and suppose that you have a diffeomorphism $f : V \to V'$. Then since $V \cap \partial\mathbb{H}^n = \varnothing$, then $V \subset \mathbb{H}^n \subset \mathbb{R}^n$ is an open subset of $\mathbb{R}^n$. You can compose the map $f$ with the inclusion $i : V' \to \mathbb{R}^n$ to get a map $$i \circ f : V \to \mathbb{R}^n.$$
Since $f$ was a diffeomorphism, the map $i \circ f$ is injective, and its differential is invertible everywhere. It follows by the inverse function theorem that $(i \circ f)(V) = V'$ is open in $\mathbb{R}^n$. Let $x \in V' \cap \partial \mathbb{H}^n$. Then since $V'$ is open in $\mathbb{R}^n$, it contains a small ball around $x$. But this ball will intersect $\mathbb{R}^n \setminus \mathbb{H}^n$, a contradiction as $V' \subset \mathbb{H}^n$.