Noether‘s theorem: Why can function be dependent of $\dot{q}$? We define a continuous symmetry in Lagrangian mechanics as follows:
$$\delta L\overset{!}{=}\epsilon\frac{\mathrm{d}}{\mathrm{d} t} f(q,\dot{q}, t)$$
Where $\epsilon\in\mathbb{R}$ is a parameter in the transformation:
$$q(t)\rightarrow q^{\prime}(t):=q(t)+\epsilon\chi(t)$$
My question is now why $f$ can be dependent of $\dot{q}$ since only functions of the type $\frac{\mathrm{d}}{\mathrm{d} t} f(q,t)$ leave the EL equations invariant.
 A: First of all, it seems to me that we are discussing 1st order Lagrangians, since the issue is raised in the Lagrangian formulation of classical mechanics where the Lagrangian contains first order derivatives $\dot{q}$ but not higher order derivatives. We are therefore looking for a curve $t \mapsto (q(t),\dot{q}(t))$ satisfying
$$\left.\frac{d}{dt}\right|_{(q(t),\dot{q}(t))} \frac{\partial L(t,q, \dot{q})}{\partial \dot{q}}= \left.\frac{\partial L}{\partial q}\right|_{(q(t),\dot{q}(t))}, \quad\quad \left.\frac{dq}{dt}\right|_{(q(t),\dot{q}(t))} = \dot{q}(t)\tag{1}$$
The variable $\dot{q}$ is independent of the variables $t$ and $q$ otherwise the derivative
$\frac{\partial L(t,q, \dot{q})}{\partial \dot{q}}$ would be of dubious interpretation. The relation between $q$, $t$, and $\dot{q}$ is given by the second equation $\frac{dq}{dt}= \dot{q}$ and it is valid only along the solution of the equations we are looking for. The variables appearing in $L(t,q,\dot{q})$ are independent of each other before imposing the EL equations.
Within this context it should be  evident that terms like $\frac{d}{dt} f(t,q,\dot{q})$ cannot be added to a Lagrangian of the form $L(t,q,\dot{q})$ if declaring that equations (1) would be preserved. Interpretative problems pop out: what is the nature of $\ddot{q}$? The interpretation in terms of derivatives is valid on the equation of motion and only for $\dot{q}$, in the equations (1) which are argued to be preserved.
If instead working within the more general setup pointed out in @Qmechanic's answer, the equations are always of arbitrary order which, in turn, is determined by the Lagrangian itself.  In this framework, using EL equations of higher order
$$-\frac{d^2}{dt^2}\frac{\partial L}{\partial \ddot{q}}+ \frac{d}{dt}\frac{\partial L}{\partial \dot{q}}=\frac{\partial L}{\partial q}\:, \quad \quad 
\frac{dq}{dt} = \dot{q}\:, \frac{d^2q}{dt^2} = \ddot{q}$$
when adding the term  $\frac{d}{dt}f(t,q,\dot{q}))$ to the original Lagrangian $L(t,q, \dot{q})$, the final form of the EL equations are  again (1) at the end of computation.
However, in classical mechanics, where the equation of motion are of the form (1), one cannot add terms $\frac{d}{dt} f(t,q,\dot{q})$ to a 1st-order  Lagrangian. As a matter of fact, everything depends on the personal idea of EL equations.
The story is different when, always sticking to classical mechanics with equations of the form (1), one passes to deal with the Noether theorem. In that case transformations of coordinates $q \to q'(q, \dot{q})$, $\dot{q} \to \dot{q}'(q, \dot{q})$  such that the Lagrangian transforms to
$$L(t, q, \dot{q}) \to L'(t, q, \dot{q}) + \frac{d}{dt}f(t,q,\dot{q})$$
are admitted.
The crucial point is that, above,
$$ \frac{d}{dt}f(t,q,\dot{q}) := \frac{\partial f}{\partial t}+
\frac{\partial f}{\partial q} \dot{q} + \frac{\partial f}{\partial \dot{q}} \ddot{q}(t,q,\dot{q}) \:,$$
where $\ddot{q}$ is not an independent new variable, but it is a known function of $t,q,\dot{q}$. The function
$$\ddot{q} := \ddot{q}(t,q,\dot{q})$$
is obtained by making explicit the equations of motion (1) and writing down the second derivative of $q$ as a function of $t,q, \dot{q}$.
The coordinate language is very cumbersome to analyze these mathematical (subtle) relations and a much better approach is the one based on the use of vector fields on $TQ$ or over a suitable jet bundle.
A: Before getting into Noether's theorem, it should be stressed that the Euler-Lagrange (EL) equations
$$ 0~\approx~\sum_{n\in\mathbb{N}_0}\left(-\frac{d}{dt}\right)^n\frac{\partial L}{\partial q^{(n)}}~\equiv~\frac{\partial L}{\partial q}-\frac{d}{dt}\frac{\partial L}{\partial \dot{q}}+\left(\frac{d}{dt}\right)^2\frac{\partial L}{\partial \ddot{q}}-\ldots \tag{1}$$
do not change if the Lagrangian $L$ is changed by a total derivative term
$$L~\longrightarrow L+\frac{dF(q,\dot{q},\ddot{q},\ldots;t)}{dt},\tag{2}$$
cf. e.g. this Phys.SE post.
Note however, that the change (2) may affect boundary conditions and/or existence of variational/functional derivative, cf. e.g. this related Phys.SE post.
A: There is no reason why $L$ should not depend on $\dot{q}$. On the contrary, such a dependency is required to arrive at the equation of motion and is unrelated to inclusion of a total time derivative.
The action integral is not affected, except possibly by a constant, if a total time derivative is added to the lagrangian. Hence the Euler-Lagrangr equations are not altered. The lagrangian itself ís affected and so are the conservation laws of energy, momentum and angular momentum.
