The relevance of this question concerns deciding whether or not a sequence of well-formed formulas in a text will qualify as a formal proof.
Mendelson's Introduction to Mathematical Logic on p. 25 of the 5th edition reads when defining a formal system:
"There is a finite set R$_1$, ..., R$_n$ of relations among wfs, called rules of inference. For each R$_i$, there is a unique positive integer j such that, for every set of j wfs and each wf B, one can effectively decide whether the given j wfs are in the relation R$_i$ to B, and, if so, B is said to follow from or to be a direct consequence of the given wfs by virtue of R$_i$.
A proof in L is a sequence B$_1$, ..., B$_k$ of wfs such that, for each i, either B$_i$ is an axiom of L or B$_i$ is a direct consequence of some of the preceding wfs in the sequence by virtue of one of the rules of inference of L.
A theorem of L is a wf B of L such that B is the last wf of some proof in L."
He then sets up a formal system, and describes a few others in the exercises, though those details don't matter to this question. One of his references is S. C. Kleene's Introduction to MetaMatheamtics where on p. 82 Kleene writes:
"The relation of 'immediate consequence' is defined thus. A formula is an immediate consequence of one or two other formulas, if it has the form shown below the line, while the other(s) have the form(s) shown above the line in 2, 9, 12."
2, in context, states a rule of modus ponens. 9 states a one premise universal quantifier rule, and 12 a one premise existential quantifier rule. Kleene then explains his definition of a formal proof more in detail partially by referring to the notion of an immediate consequence.
The phrases 'immediate consequence' and 'direct consequence' both suggest to me that a substitution instance of a formal theorem would qualify as a formal theorem also, but re-reading those definitions suggests that I may have read into things. That said though, other authors like Prior, Bergmann, Lukasiewicz, and papers I've seen, suggest that substitutions in theorems in axiomatic systems coheres with the definition of a formal proof (and soundness works out). But, there's also something called The Pushback Lemma which sounds like it says that for any substitution and detachment proof where we have substitutions in the formal theorems, there can get found from that formal proof a formal proof which only has substitutions in the primitive axioms or first axiom schemata.
So, does Mendelson's definition forbid substitutions in theorems in formal proofs, or does it allow substitutions in a formal theorem?