In this framework, $T$ and $p$ are not variables - they are functions of $S$ and $V$. That is, $$\mathrm dU = T(S,V) \mathrm dS - p(S,V) \mathrm dV \qquad (1)$$
When we perform a Legendre transformation to e.g. the Helmholtz energy $F$, the independent variables become $T$ and $V$ and we have $$\mathrm dF = -S(T,V) \mathrm dT - p(T,V) \mathrm dV \qquad (2)$$ whereas when perform the Legendre transform to e.g. the enthalpy $H$, we find $$\mathrm dH = T(S,p)\mathrm dS + V(S,p) \mathrm dp \qquad (3)$$
Which quantities are most convenient to choose as our independent variables depends on our circumstances.
Note that what I've written above is really a rather severe abuse of notation. For instance, the $p$'s which appear in $(1-3)$ are all different objects. The $p$ in $(1)$ is a function which eats the entropy and volume and spits out the pressure. The $p$ in $(2)$ is a different function, which eats the temperature and volume and spits out the pressure. The $p$ in $(3)$ is not a function at all, but rather an independent variable.
Say for example that you have a gas in an isolated cylinder equipped with a piston. You (reversibly) push down on the cylinder and the pressure and temperature inside rise, while the entropy stays fixed. If we examine the system through the lenses of $(1-3)$, we might say the following:
I have decreased the volume of my cylinder by an amount $\delta V$ while keeping its entropy constant. As a result, the temperature and pressure of the system become $$T(S,V-\delta V)= T_0 - \left(\frac{\partial T}{\partial V}\right)_{S} \delta V\qquad p(S,V-\delta V) = p_0 - \left(\frac{\partial p}{\partial V}\right)_S \delta V$$
I have decreased the volume of my system by some amount $\delta V$ and increased its temperature by $\delta T$ in such a way that $$S(T+\delta T,V-\delta V) = S_0 + \left(\frac{\partial S}{\partial T}\right)_V \delta T - \left(\frac{\partial S}{\partial V}\right)_T \delta V = S_0$$ $$ \implies \delta T = \frac{\left(\partial S/\partial V\right)_T}{\left(\partial S/\partial T\right)_V} \delta V$$ As a result, the pressure of my system has become $$p(T+\delta T,V-\delta V)=p_0 + \left(\frac{\partial p}{\partial T}\right)_V \delta T - \left(\frac{\partial p}{\partial V}\right)_T \delta V $$ $$= p_0 + \left[\left(\frac{\partial p}{\partial T}\right)_V \frac{\left(\partial S/\partial V\right)_T}{\left(\partial S/\partial T\right)_V} - \left(\frac{\partial p}{\partial V}\right)_T\right]\delta V $$
I have increased the pressure in my system by an amount $\delta p$ while holding the entropy constant. As a result, the volume becomes $$V(S,p + \delta p) = V_0 + \left(\frac{\partial V}{\partial p}\right)_S \delta p$$
The point is that which quantities you choose as your independent variables has nothing to do with the physical process being analyzed - it has to do with how you'd like to analyze it. In the example given above, the fact that the system is isolated (so the entropy is constant in reversible processes) means that it's simplest to choose $S$, not $T$, as an independent variable. The alternative is demonstrated in $(2)$.
Whether we choose the internal energy $(1)$ or the enthalpy $(2)$ depends on whether we'd prefer to think of it as decreasing the volume (thereby increasing the pressure) or as increasing the pressure (thereby decreasing the volume). These two perspectives are physically Though essentially equivalent but mathematically distinct, and understanding the latter will save youformer may be more operationally useful if our experiment uses a lot of thermodynamicscomputer-induced anguishcontrolled motor to move the piston some fixed distance up or down without regard for the pressure, while the latter may be more useful if we press down on the piston with a known force (thereby determining the pressure) without regard to the volume.