The wording of your question is rather vague but hopefully the following will hint at least a little at one example of how the semi-direct product of the fundamental groups of topological spaces can arise naturally in common constructions. I apologise in advance if any of the definitions below aren't known to you. They should all be easily searchable on wikipedia.
If you don't know anything about fiber bundles (or the more general family of maps fibrations) then to put it very loosely, a map $p\colon E\rightarrow B$ is a fiber bundle if for all $b\in B$, the preimage of a neighbourhood $U\ni b$ is homeomorphic to the product of some space $F$ and $U$. That is, $p^{-1}(U)\cong F\times U$. We often write that the sequence of maps $F\rightarrow E\rightarrow B$ is a fibration sequence with fiber $F$ (the first map in this sequence is just inclusion of $F$ in $E$).
The proper definition puts some restrictions on the map $p$ but the above definition is good enough to give an intuitive feel for what fiber bundles 'look like'. The important part you should take away from the definition is that the space $E$ can be seen as a kind of 'twisted product' of the spaces $F$ and $B$. You should hopefully already be able to see a loose parallel between fiber bundles and semi-direct products of groups.
A very useful property of fiber bundles of 'nice spaces' (roughly speaking, if all the spaces involved are CW-complexes then we're fine) is that the homotopy groups of the fibration sequence fit in to a long exact sequence. Now, suppose that the space $F$ is connected and $\pi_2(B)=0$. Then from this long exact sequence in homotopy, we can extract the short exact sequence $$\pi_2(B)=0\rightarrow\pi_1(F)\rightarrow\pi_1(E) \rightarrow\pi_1(B)\rightarrow 0=\pi_0(F)$$ and now it should be clear that if this short exact sequence splits, then the splitting lemma for non-ableian groups tells us that $\pi_1(E)\cong \pi_1(F)\rtimes \pi_1(B)$.
The conditions on the homotopy groups of $B$ and $F$, and the requirement that the short exact sequence splits are rather specialised. So, this is far from a universally useful construction, but hopefully it's the sort of link between fundamental groups and semi direct product of groups that you were looking for.
Following the comments of KotelKanim below, the conditions on the homotopy groups of $B$ and $F$ are not necessary as long as the fiber bundle involved has a section. This means that there exists a map $s\colon B\to E$ such that $p\circ s=\mbox{Id}_B$.
Suppose the bundle $p$ has a section $s$ and let $\delta\colon\pi_n(B)\to\pi_{n-1}(F)$ be the connecting homomorphism in the associated long exact sequence of homotopy groups. Suppose $\ker\delta\neq\pi_n(B)$. Then by exactness at $\pi_n(B)$ we have $\mbox{Im}\, p_*\neq \pi_n(B)$ and so let $h$ be an element of $\pi_n(B)\setminus\mbox{Im}\, p_*$. We have $h=\mbox{Id}_{\pi_n(B)}(h)=p_*(s_*(h))$ but then this implies that $h\in\mbox{Im}\, p_*$ which is a contradiction. It follows that $\ker\delta=\pi_n(B)$ and so $\mbox{Im}\,\delta=0$.
Hence we get the augmented long exact sequence in homotopy
$$\cdots \rightarrow \pi_{n+1}(B)\rightarrow 0\rightarrow\pi_n(F)\rightarrow\pi_n(E) \rightarrow\pi_n(B)\rightarrow 0 \rightarrow \pi_{n-1}(F) \rightarrow \cdots$$ because $\delta$ factors through $0$ and so we have a split short exact sequence for each $n$ which, by the splitting lemma, gives us the isomorphism $\pi_n(E) \cong \pi_n(F) \oplus \pi_n(B)$ for $n\geq 2$ (as higher homotopy groups are abelian) and for $n=1$ gives us the previous semi-direct product.
Theorem: If $G$ is a finitely generated group acting non-trivially and without inversions on a tree $X$, and if the edge stabilizers are finitely generated, then the vertex stabilizers are also finitely generated.
The theorem follows by combining three fairly elementary lemmas which I state below. The proof of these can be found in the following book:
D. E. Cohen, Combinatorial Group Theory: A Topological Approach. Cambridge etc.: Cambridge University Press (1989); ZBL0697.20001.
We say a graph of groups is finite if the underlying graph is a finite graph.
Lemma 1: If $G$ is a finitely generated group acting non-trivially and without inversions on a tree $X$, then $G$ is the fundamental group of a finite graph of groups $\mathcal{Y}$. If $G_v$ is a vertex stabilizer under the action of $G$ on $X$, then either it is isomorphic to an incident edge stabilizer or it is conjugate to a vertex group of $\mathcal{Y}$.
Lemma 2: Let $I$ be a set and $H$ an HNN extension of the form $$ H = \langle A, t_i \mid t_iB_it_i^{-1} = B_{-i} \, \forall i\in I\rangle. $$ If $H$ is finitely generated then I is finite and $A$ is finitely generated.
Lemma 3: Let $H = A \ast_C B$. If $H$ and $C$ are finitely generated then so are $A$ and $B$.
Best Answer
Let $F_1,F_2$ be non-cyclic finitely generated groups. Suppose that $G=F_1\times F_2$ acts unboundedly, inversion-free, on a tree $T$ with cyclic edge stabilizers.
Suppose that each element of $F_1$ acts with a fixed vertex. Then $F_1$ has a fixed vertex (this is a general fact on tree actions of f.g. groups). Let $T_1$ be the set of vertices fixed by $F_1$. Then $T_1$ is a subtree, and is $F_2$-invariant. By minimality, we deduce that $T=T_1$, and hence $F_1$ acts trivially. Since $F_1$ is not cyclic, it follows that edge stabilizers are not cyclic, contradiction.
So some element $g_1$ of $F_1$ is loxodromic, with axis $A_1$. Similarly, some element $g_2$ of $F_2$ is loxodromic, with axis $A_2$. Since $F_2$ commutes with $g_1$, $F_2$ preserves $A_1$, and hence $A_2=A_1$, and since $F_1$ commutes with $g_2$, $F_1$ preserves $A_2=A_1$. So the action preserves an axis, hence by minimality $T$ is reduced to an axis.
Hence $G$ modulo a cyclic normal subgroup is trivial, of order $2$, infinite cyclic, or dihedral. This is excluded by the assumptions.