Hamilton's Principle - achieving Hamilton equations Consider the action function:
$$\mathcal{S}(t)=\int_{t_1}^{t_2}\mathcal{L}(q_i,\dot{q_i},t) dt$$
where $\mathcal{L}$ is the Lagrangian of the system.
The Hamiltonian is defined by the following expression:
$$\mathcal{H(q_i,p_i,t)}=\dot{q_i}p_i-\mathcal{L}(q_i,\dot{q_i},t)$$
So we have,
$$\mathcal{S}(t)=\int_{t_1}^{t_2}\left[\dot{q_i}p_i-\mathcal{H}(q_i,{p_i},t)\right] dt$$
The Hamilton's Priciple says that $\delta\mathcal{S}=0$.
So we have,
$$\delta\mathcal{S}(t)=\int_{t_1}^{t_2}\left[\delta(\dot{q_i}p_i)-\delta\mathcal{H}(q_i,{p_i},t)\right] dt$$
I found on Goldstein 3rd edition that they considered the next step as
$$\delta\mathcal{S}(t)=\int_{t_1}^{t_2}\left(\delta\dot{q_i}p_i+\dot{q_i}\delta p_i- \frac{\partial\mathcal{H}}{\partial q_i}\delta q_i  - \frac{\partial\mathcal{H}}{\partial p_i}\delta p_i \right)dt$$


*

*Didn't they miss the $\frac{\partial\mathcal{H}}{\partial t}\delta t$ term resulting from $\delta\mathcal{H}$?

*One more question: Is it true that $\frac{d}{dt}(\delta q_i)=\delta \dot{q_i}$?
 A: *

*No, there is usually no variation of the independent coordinates (in this case: the time coordinate $t$), when deriving Euler-Lagrange equations. Only the dependent variables (in this case: $q^i(t)$ and $p_i(t)$) are varied. 

*Yes, $\frac{d}{dt}(\delta q^i)=\delta \dot{q^i}$, see e.g. this Phys.SE post, which also discusses situations, where it's not the case.
A: EDIT:
For the first part, after reading Goldstein's approach, it doesn't seem like he assumes that the Hamiltonian is generically time independent, i.e. $\frac{\partial \mathcal H}{\partial t}\neq 0$ in general. However, since we are performing our variation wrt to the "path", and it doesn't make sense for $t$ to have any dependence (implicit or explicit) on the path, so its variation must be $\delta t=0$. (In the standard derivation, we consider a perturbation $\epsilon \eta (t)$ to the path with appropriate boundary conditions and vary wrt to $\epsilon$, clearly we must have $\frac{\delta t}{\delta \epsilon}=0$.)
For the second part, since we are varying $\mathcal S$ wrt the path, and this is completely independent of the derivative with respect to $t$, the two derivatives commute and the expression you have stated is true. (In the standard derivation, we vary wrt to $\epsilon$ but that's not essential - what is is that a variation wrt the path, however we might "parametrize" this variation, is independent of a derivative wrt time at a conceptual level).
A: The derivation should work even for time dependent Hamiltonians.  The issue is that we are not considering variations of the time parameterization, so $\delta t = 0$.
You are correct that $\delta \dot q = \frac{d}{dt}\delta q$.  Basically, the variation operation is defined in terms of a derivative, so it commutes with regular derivatives.
Old editions of Goldstein have a chapter on the calculus of variations as a mathematical tool, separate from physical applications.  If that chapter still exists in your edition, you may want to review it.
