If $f(x)$ is a separable polynomial of degree $n$ then its Galois group is a subgroup of $S_n$ (via the action on the roots). And in fact any subgroup $H$ of $S_n$ occurs as a Galois group of a separable polynomial of degree $n$ over some field.
From this we get that if $f,g$ are polynomials of respective degrees $n,m$ then the Galois group $G$ of $f(g(x)$ is a subgroup of $S_{nm}$. However here not every subgroup can be achieved, because the action of $G$ on the roots of $f(g(x))$ is imprimitive (provided $n,m>1$).
The group that should replace $S_{nm}$ is the permutational wreath product $S_m\wr_n S_n$. Then one can show that $G$ always embeds into $S_m\wr_n S_n$, via the action on the roots, and that for any subgroup $H$ of $S_m\wr_n S_n$, there are a field $K$ and $f,g\in K[X]$ of respective degrees $n,m$ such that $Gal(f(g(x)),K)\cong H$.
I will end with the definition of the permutational wreath product: it is the semi-direct product $S_m^n \rtimes S_n$ where the action of $S_n$ on $S_m^{n}$ is the translation action, that is $ (\tau_1, \ldots, \tau_n)^\sigma := (\tau_{\sigma(1)}, \ldots, \tau_{\sigma(n)}) $ for all $\tau_i\in S_m$ and $\sigma\in S_n$.