Let $d \geq 2$ be an integer, and let $\mathcal{F}_d$ be the family of finite groups such that $G \in \mathcal{F}_d$ if and only if every subgroup of $G$ can be generated by at most $d$ elements.
Is there a finite nontrivial word $w = w(x_1, \dots, x_n)$ which is trivial on $\mathcal{F}_d$?
That is, can it be that for any choice of $G \in \mathcal{F}_d$ and $y_1, \dots, y_n \in G$ we have $w(y_1, \dots, y_n) = 1$.
Alternatively: Let $F$ be a free group of rank $\aleph_0$. Is it possible that the intersection of all finite index subgroups $N \lhd F$ with $F/N \in \mathcal{F}_d$ is nontrivial?
I am also interested in the analogous question for $p$-groups.