First of all,mechanical energy isn't conserved when $\vec{F_{nc}}$ is there in the system unless it does zero work.So the proof is coming not exactly similar to proof of work energy theorem but quite relatable to that.
Coming to swapping differentials, isn't that like this: $$adx=\frac{dv}{dt}dx$$ Multiplying and dividing by $dt$ $$adx=\frac{dv}{dt}\frac{dx}{dt}dt$$ $$ = \left( \frac{dv}{dt} dt \right) \frac{dx}{dt}$$ $$ = \frac{dx}{dt} dv$$ Now, $$adx=vdv$$
The last integral $\int_C (a_x \hat{i}_x + a_y \hat{i}_y + a_z \hat{i}_z) \cdot d\vec{r}$ can be carried out if $d\vec{r}$ is written as: $$dx\hat{i}_x+dy\hat{i}_y+dz \hat{i}_z$$ Carrying out the dot product with $\vec{a}$, it will be given as: $$a_{x}dx+a_{y}dy+a_{z}dz$$
It's easy to swap differential here as we get $a_{x}dx=v_{x}dv_{x}$, $a_{y}dy=v_{y}dv_{y}$ and $a_{z}dx=v_{z}dv_{z}$.