In Stephen Cole Kleene, Mathematical Logic (1967 - Dover reprint : 2002) there is a counterexample to the rule : $"A(x)\vdash\forall xA(x)"$.
The counterexample is (pag.110):
we are not justified in saying $"R \rightarrow P(y) \vdash R \rightarrow \forall x P(x)"$. In fact, this is not true, since [by soundness, is not the case that] $"R \rightarrow P(y) \vDash R \rightarrow \forall x P(x)"$ were true.
Elliott Mendelson, Introduction to Mathematical Logic (4th ed - 1997) uses the generalization rule; trying the same example in Mendelson's system, we have :
1) $R \rightarrow P(y)$ --- assumption
2) $R$ --- assumption
3) $P(y)$ --- 1,2 MP
4) $\forall yP(y)$ --- 3,Gen
5) $R \rightarrow \forall yP(y)$ --- 2,4 by Deduction Th ($y$ not free in $R$)
Is it correct ? Of course, I cannot have : $\vdash (R \rightarrow P(y)) \rightarrow (R \rightarrow \forall yP(y))$ because now $y$ is free in $R \rightarrow P(y)$ and so DT does not apply.
May I say that this is acceptable in Mendelson's system because in it the deducibility relation ( $\vdash$) tracks validity and not logical consequence (according to Mendelson definition) ?