This is an integral in my lecture and they said that the chain rule is used here to produce the second equation.
I understand the chain rule with single variables however I am baffled here and how the chain rule applies to multivariable equations since I don't think we can 'cancel out' anything due to partial derivatives being different to derivatives.

The chain rule for multivariate maps states that the Jacobian of a map that is the two composition of two maps is the (matrix) product of the Jacobians of two maps.
This is what is applied in the special case you mention in your question.