Do formal polynomials make sense in arbitrary algebraic structures? Let $R$ denote a commutative ring with unity and $X$ a set of formal indeterminates. Then intuitively, the set of all formal polynomials in $X$ with coefficients in $R$ can be defined as the free commutative ring with unity generated by $R \cup X$ subject to the identities satisfied by $R$.

Question 1. Does this definition actually work?

If so, then I think that formal polynomials make sense in arbitrary algebraic structures. So my second question is:

Question 2. Irrespective of whether the above definition makes sense, do formal polynomials make sense in arbitrary algebraic structures?
Q1: Yes. But I would rather say that $R[X]$ is the free commutative $R$-algebra on $X$.

Q2: The notion of "free objects" can be defined in a very general category-theoretic setting, see Wikipedia or any book on category theory. In particular, we have the notion of a free algebraic structure of any given type. We have free monoids, free groups, free modules, free lie algebras, free boolean algebras, etc. But notice that the elements aren't called polynomials anymore, because they are just no polynomials.
Yes and you can call them polynomials. See Cox et al "Using Algebraic Geometry" for examples of polynomials over $\mathbb{Q}$, $\mathbb{Z}$ and other rings.