Yes, your justification is correct, but it is important that not only are $f$ and $f_x$ continuous, but their $C^0$ norm is controlled by their Sobolev norm, so that a uniform bound can be derived. In particular, since by Sobolev embedding theorem since the order $k = 2 > n/2$ with $n = 1$ being the dimension of the spatial domain, then there is a constant $C$ such that
$$
\|f(\cdot, t)\|_{C^0(0,L)} \le C \| f(\cdot, t)\|_{H^2(0,L)}
$$
for every $t$. Since $f(\cdot, t) \in C((0,T); H^2)$ then $\| f(\cdot, t)\|_{H^2(0,L)} \le M$ for some $M$, for every $t$. Therefore
$$
|(f^p)_{xx}(x,t)| \le p (p-1) (CM)^{p-2} |f_x(x,t)|^2 + p (CM)^{p-1} |f_{xx}(x,t)|,
$$
and Sobolev embedding can again be applied instead to $f_x$ to show that it is bounded in $x$. Carrying out the inequalities and integrating gives you a universal bound on $\|(f^p)_{xx}(\cdot, t)\|_{L^2(0,L)}$ that is a polynomial expression in $C,M,p$.