Over an infinite integral domain you can classify all polynomials that satisfy the associativity functional equation. A quick degree consideration of both sides tells you that the polynomial is at most degree $1$ in each variable, so the only answers are $x,y, c+x+y$ and $c_1(x+c_2)(y+c_2)-c_2$. In fact you can classify all $n$-variable polynomials which satisfy the $n$-ary version of associativity, as done in the paper "A description of n-ary semigroups polynomial-derived from integral domains".

As far as finite rings, I doubt you can say anything meaningful. For example, already over $\mathbb Z/p\mathbb Z$, any binary function can be written as a polynomial map, so you would be asking for a classification of all associative operations on this set (this number increases very fast).