HNN extensions as fundamental groups
The best reference for this (at least to me) is these lecture notes. Just go through the first 5 pages. There are many pictures also.
Since there are several base points involved, as mention by Lor, there is value in using groupoids for HNN extensions. An account of this is on p. 335 of Topology and Groupoids, as follows.
Let $i_A:A \to G, i_B:B \to G$ be inclusions of two subgroups of $G$, and suppose given an isomorphism $\theta: A \to B$. Let $\mathbf I$ be the groupoid with two objects $0,1$ and exactly one arrow $\iota: 0 \to 1$, and let $\dot{\mathbf I}$ be the discrete subgroupoid of $\mathbf I$ on the elements $0,1$. Form the pushout of groupoids $$ \begin{matrix} A \times \dot{\mathbf I} &\to^i & G \cr \downarrow_j && \downarrow_\phi \cr A \times {\mathbf I} & \to_\psi & H \end{matrix} $$ where $i$ is the morphism $(a,0) \mapsto i_A a, (a,1)\mapsto i_B\theta a$, $j$ is the inclusion and $\phi, \psi$ are defined by the pushout. Let $t= \psi(e,\iota)$ where $e$ is the identity element of $A$. Then one checks that this gives the usual presentation of an HNN extension.
There is a general point here about modelling the topology. For example, the trefoil group $T$ has the presentation $\mathcal P= \{x,y:x^2=y^3\}$. The topological model would seem to be the pushout of spaces determine by the two maps $f,g:S^1 \to S^1$ in which $f$ is $z \mapsto z^2$, and $g$ is $z \mapsto z^3$. However this pushout is not even Hausdorff! So we take the double mapping cylinder, or homotopy pushout, $M(f,g)$ and its fundamental groupoid $$\mathbf T= \pi_1(M(f,g), \{0,1\})$$ on two points $0,1$ has generators $x$ at $0$, $y$ at $1$ and $\iota$ joining $0$ to $1$ with one relation $x^2\iota=\iota y^3$.
So if one wants homotopy pushouts in group theory it is convenient to extend the area of discourse to groupoids. This analogy between homotopies of maps of spaces and homotopies of morphisms of groupoids was pointed out in the 1968, differently named, edition of "Topology and Groupoids".