First, I ask my question and then I add some explanations:
Suppose that $A$ and $B$ are two commutative rings such that $A[X] \cong B[X]$ as rings. Denote by $D_A$ the set of all positive integers $n$ such that there exists an irreducible polynomial of degree $n$ over $A$ — the same for $D_B$. Is it true that $D_A = D_B$?
Some time ago, I wanted to find many proofs (like here) that $\Bbb Z[X]$ and $\Bbb R[X]$ are not isomorphic (obviously they are not because they don't even have the same cardinality, I know). I thought to the following argument:
"The irreducible polynomials in $\Bbb R[X]$ have degree $≤2$, while irreducible polynomials in $\Bbb Z[X]$ can have arbitrary large degree (for instance $X^n+2X^{n-1}+\cdots+2X+2$, by Eisenstein's criterion)".
But I wasn't sure of the correctness of this argument. The isomorphism $A[X] \cong B[X]$ is not required to preserve the degree. If it is preserved, then my claim should be true. I think that examples like this could prevent the isomorphism from preserving the degree.
A possibly relevant question is What are the possible sets of degrees of irreducible polynomials over a field?, on MO. In particular, this can be interesting when $D_A$ and $D_B$ are infinite.
Thank you for your comments!