Usually when the variational principle is introduced one starts by defining a Lagrangian density
$${\mathscr L}(x,\phi(x),\partial_{\mu}\phi(x))$$
and an action
$$S[\phi]=\int_R d(x) {\mathscr L}$$
Then one tries to find the form of $\phi(x)$ that makes the value of $S$ be an extremum (either maximum or minimum). To solve this problem one applies a "small" perturbation to $x$ and $\phi$ to see how the value of $S$ is modified. Thus by "taking the limit" to smaller and smaller perturbations results in an infinitesimal change $\delta S$ which is set to zero.
Now there are several ways to implement the "small" perturbation. One is to construct the homotopy between two functions that contains the solution. This means that we have a family of functions $\phi(x;\epsilon)$ parametrized continuously by $\epsilon$. However, one can argue that the homotopy cannot contain all possible variations because it only contains the "intermediate" functions of the deformation of the initial function to the final one.
Another way, which is contained in most physics textbooks, is to consider the transformations: $$x^\mu\to x'^\mu=x^\mu+\delta x^\mu$$ $$\phi(x)\to \phi'(x)=\phi(x)+\delta \phi(x)$$ Where both $\delta x^\mu$ and $\delta \phi(x)$ are arbitrary small functions of $x$. Now, the lagrangian density also depends on $\partial_\mu \phi(x)$ so it is straightforward to take another small function, say $\delta \partial_\mu\phi(x)$, and consider $$\partial_\mu \phi(x) \to \partial_\mu \phi'(x) = \partial_\mu \phi(x)+ \delta\partial_\mu \phi(x)$$ However, taking the derivative of the fourth equation gives $$\partial_\mu \phi(x)\to \partial_\mu \phi'(x)=\partial_\mu \phi(x)+\partial_\mu (\delta \phi(x))$$ Then it is tempting to identify $$\delta \partial_\mu\phi(x)=\partial_\mu (\delta \phi(x))$$ But here is the question: how can we guarantee that the identification is correct? i.e. that $\partial_\mu (\delta \phi(x))$ is small. For example I can think of a variation of the kind $$\delta \phi(x)=\epsilon \sin\left(\frac{1}{x-a}\right)$$ where $\epsilon$ is a small number and $a$ a constant. Then obviously even when $\delta \phi(x)$ is small, $$\partial_\mu (\delta \phi(x))=-\frac{\epsilon}{(x-a)^2}\cos\left(\frac{1}{x-a}\right)$$ so we cannot guarantee that this variation is small close to $a$.