The question is in the title, what follows is an example.
Consider for example a free classical particle in a 1D box of length $L$ in contact with a thermal reservoir. According to Boltzmann the probability that it is in a state of energy $E$ is $\exp(-E/kT)$, so we calculate the partition function by integrating over all states:
$$Z = \int dq\ dp\ e^{-\beta H(p, q)} = \int dq\ dp\ e^{-\frac{\beta}{2m} p^2} = L \sqrt{2\pi m k T}$$
Now, I don't see why we couldn't label states by $(q, \dot q)$ instead of $(q, p)$; if we did that we would get
$$Z = \int dq\ d\dot{q}\ e^{-\beta E(\dot q, q)} = \int dq\ d\dot{q}\ e^{-\frac{\beta m}{2} \dot{q}^2} = L \sqrt{\frac{2\pi k T}{m}}$$
which is different. Now, in this case the difference doesn't matter since $F = -kT \log Z$ and an additive constant just shifts the energy. Will this always be the case? Or is there a system for which the two partition functions have a nontrivial difference, and in that case, why do we use $p$ instead of $\dot q$ as an integration variable?