The theorem statement is as follows.
$(A,\mathcal{D}(A))$ is the generator of a Feller semigroup and $(B,\mathcal{D}(B))$ extends $(A,\mathcal{D}(A))$ in the sense that $\mathcal{D}(A) \subset\mathcal{D}(B)$ and $A$ and $B$ agree on $\mathcal{D}(A)$. Suppose that $Bu = u \implies u = 0$ whenever $u \in \mathcal{D}(A)$. Then the two generators and their domains are equal.
The proof of this theorem starts as follows. Pick some arbitrary $u \in \mathcal{D}(B)$ and set
$$g:= u - Bu$$
$$h:= (\text{id}-A)^{-1}g$$
Then, $h \in \mathcal{D}(A)$. I don't know why this last statement is true. I know that $(\text{id}-A)^{-1} = U_1$ with $U$ being the resolvent of the semigroup $A$ belongs to. I don't know what class $g$ belongs to and I don't see any property of resolvents saying that they map certain classes of functions to the domains of their underlying generators. Hopefully, this is not too straightforward.
If $T \mathpunct{:} \mathcal{D}(T) \to V$ is an unbounded linear operator on a Banach space $V$ then we say that $T$ is invertible if it has a bounded inverse operator $T^{-1} \mathpunct{:} V \to \mathcal{D}(T)$. Let $\rho(T)$ be the set of $\lambda \in \mathbb{C}$ such that $\lambda - T$ is invertible. $\rho(T)$ is called the resolvent set of $T$.
Let $X$ be the state space of the Markov processes under consideration (where $X$ is usually assumed to be a locally compact Hausdorff space with countable base) and let $C_0(X)$ be the space of real-valued continuous functions on $X$ which vanish at infinity, equipped with the sup norm so that $C_0(X)$ is a Banach space.
If $A$ is the generator of a Feller semigroup on $C_0(X)$ then $(0, \infty) \subset \rho(A)$ and hence, in particular, $(\text{Id} - A)$ is invertible. Since $B \mathpunct{:} \mathcal{D}(B) \to C_0(X)$ we have that $g \in C_0(X)$. Therefore $h \in \mathcal{D}(A)$ since $(\text{Id}-A)^{-1} \mathpunct{:} C_0(X) \to \mathcal{D}( \text{Id} - A) = \mathcal{D}(A)$.