Is the equation dG = Vdp − SdT valid only for a reversible process? Can it be applied for an irreversible one too?
The easiest way to avoid confusion is to start from the expression for the $pV$ work associated with a reversible process:

$$\mathrm dw_\mathrm{rev} = -p_\mathrm{ext}\,\mathrm dV = -p\,\mathrm dV$$

where $p$ is the internal pressure of the system, and here the system is subjected to $pV$ work only. Yes, it is absolutely true that for reversible $pV$ work the condition $p_\mathrm{ext} = p$ holds. While you came to that conclusion, you did so in a flawed way because your expressions for $\mathrm dH$ are not correct. 

The above definition of reversible $pV$ work leads to the expression for $U$ in terms of $pV$ work and entropy $(\mathrm dU = -p\,\mathrm dV + T\,\mathrm dS),$ and ultimately, through the definition $H = U + pV,$ to the expression $\mathrm dH = V\,\mathrm dp + T\,\mathrm dS.$


  But my teacher argued that because this is a state function, it should be valid for all types of processes.


The laws of thermodynamics hold irrespective of path. Provided the end points are the same, two different paths will result in the same changes in state variables.

In practice, when attempting to determine the change in a state variable by evaluating a path integral, you want to choose a convenient path. This is usually a reversible one because then the work can be related to equation of state variables, and the entropy change can be related to the heat via the second law.