You can apply chain rule if $v$ is differentiable wrt $x$ and $x$ is differentiable wrt $t$. I think there are no other conditions,as this post on MathSE seems to say, https://math.stackexchange.com/questions/688152/necessary-conditions-for-the-chain-rule-of-differentiation-to-be-valid#_=_
and this condition is not always available. When $v=0$,make sure $\frac{dv}{dx}$ exist.
Related post:When can one write $a=v \cdot dv/dx$?When can one write $a=v \cdot dv/dx$?