When evaluating a definite integral by integrating by parts is the following allowed?

No.

If $F'(x) = f(x)$ for all $x \in [a,b]$ then IBP (regarding $g(x)$ as the thing to be differentiated and $f(x)$ the thing to be antidifferentiated) says: \begin{align*} \int_a^b f(x) g(x) \, dx & = \left[g(x) F(x)\right] \Big \vert_a^b - \int_a^b F(x) g'(x) \, dx \\ & = (g(b) F(b) - g(a) F(a)) - \int_a^b F(x) g'(x) \, dx. \end{align*} Note that an antiderivative $F$ of $f$, which is a function (not generally a number), is involved in this formula. In particular, the first term on the extreme right hand side is $g(b) F(b) - g(a) F(a)$, and not $\left(\int_a^b f(x) \, dx \right) \cdot \left (g(x)\Big \vert_a^b \right)= (F(b) - F(a)) (g(b) - g(a))$, and the integral on the extreme right hand side involves the function $F(x)$, and not the number $\int_a^b f(x) \, dx = F(b) - F(a)$.

See a related question here: For valid probability densities $p(x)$ and $q(x), \int p(x)\ln(q(x))~dx = 0$. Can you catch my mistake?. There the fallacy was similar: integration by parts requires an antiderivative of a function, not just one single definite integral involving that function. (Their $p(x)$ is playing a role analogous to $f(x)$ here.)