There are different interpretations for any FOL sentence. One of several things that we should specify when we choose some interpretation is domain of discourse over which we quantify. What is not clear for me is what is allowed to be in this domain. Can we have domain of discourse consisting of some functions for example? From one side I have never seen any limitations for contents of domain, so why not? But from another side as far as I know we can't quantify over functions and predicates in FOL, so it implies that we can't add functions in domain of discourse. So I am not sure about the answer for this question.
Sorry if it is a very stupid question, perhaps I have some deep misunderstanding. But for me it looks quite important to understand with what kind of objects we can legally work in scope of FOL.
Long story short: Our domain can include functions and we can quantify over them. However, we cannot quantify over function letters, which are interpreted as functions on our domain of discourse (from now on, we will use the term universe).
For example, fix a group G, and consider its automorphism group Aut(G). It is a legitimate group, in particular it meets the condition $\forall g \in Aut(G), g \circ e = g$. Since its elements are functions (in particular automorphisms) we have in some sense quantified over functions. More generally, we can include any objects in our universe as long as it remains a set in the sense of our meta- theory, typically ZFC. Once we fix our universe, however, we cannot quantify over functions that our defined on our universe.
Again, and in other words, you are correct to say we cannot quantify over function letters and predicate letters in FOL. That is, by the typical semantics of FOL, $\forall x. P$ is true iff $M \models P[x/a]$, where x has been substitued for any element of the universe. Now, if that element of the universe happens to be a function, that is fine. However, it will not be picked out by a function letter, since function letters are mapped to functions whos domain is our universe by defintion of a first order structure.