Yes, the coefficients of a polynomial function can be π or -π or π/2, or any other irrational number such as -√2.
The constraint on polynomials is that the exponents of the variable be natural numbers (positive integers).
In high school, we generally limit our studies to polynomials with real coefficients. That way, a real input is guaranteed to generate a real output. However, we do allow for complex inputs, because we care about complex roots of polynomials.