In $\mathbb{Z}[X]$ what inputs can X take? In the polynomial rings $\mathbb{Z}[X]$ or more generally $R[X]$ what inputs can we put in the place of X.
For example in $\mathbb{Z}[X]$. X can be replaced by any real or complex numbers.
But in general can we put any member of any set in the place of X ?
 A: In $R[X]$, $X$ is an indeterminate, i.e. a symbolic variable.
When you say you "put" some $x$ in place of $X$, you're talking about the mapping
$f_x: \sum_i r_i X^i \mapsto \sum_i r_i x^i$.
If $R$ is a commutative ring and $x$ a member of some commutative ring $S$ that contains $R$, this is a ring homomorphism of $R[X]$ into $S$.
A: Let $A$ be a ring with unit, which need not be commutative. Let $a \in A$. Then there is a unique ring homomorphism $\mathbb{Z}[X] \to A$ such that $X \mapsto a$. This homomorphism is of course given by $f(X) \mapsto f(a)$, suitably interpreted. That is, $nb = b + b + \cdots + b$ ($n$ times) for $n \in \mathbb N$ and  $b \in A$.
Bottom line: you may put in the place of $X$ any object for which you know how to multiply by itself and add to itself. One prime example is square matrices with entries in a ring.
For general coefficient rings $R$, all you need is a ring homomorphism $\phi: R \to A$ such that $\phi(r)$ commutes with $a$ for all $r \in R$. One common condition is this direction is to require that $\phi(R)$ is contained in the center of $A$. This effectively makes $A$ into an $R$-algebra. See Wikipedia.
