Yes, that works fine, e.g. if $\ x\mid y\ $ in $\,\Bbb Z[x,y]\,$ then $\ 0\mid 1\ $ in $\,\Bbb Z\,$ by evaluating at $\,x,y = 0,1.$
Remark $\ $ Often one can deduce much information about divisibility of polynomials by examining the divisibility of their evaluations. For example, the possible factorizations of a polynomial $\in\Bbb Z[x]$ are constrained by the factorizations of the integer values that the polynomial takes. For a simple example, if some integer value has few factorizations (e.g. it is a unit $\,\pm1 $ or prime $p$) then the polynomial must also have few factors, asssuming that that the factors are distinct at the evaluation point. More precisely
If $\, f(x) = f_1(x)\cdots f_k(x)\,$ and $\,f_i\in\Bbb Z[x]\,$ satisfy $\color{#0a0}{f_i(n) \ne f_j(n)}\,$ for $\,i\ne j,$ all $\,n\in \Bbb Z$
$\quad \color{#c00}{f(n) =\pm1}\,\Rightarrow\, k\le 2\ $ else $1$ would have $\rm\,3\,\ \color{#0a0}{distinct}$ factors $\,f_1(n),f_2(n),f_3(n)$
$\quad f(n) = \pm p\,\Rightarrow\, k\le \color{#c0f}4\ $ since a prime $p$ has at most $\,\color{#c0f}4\,$ distinct factors $\,\pm1,\pm p$
One can push the key idea to the hilt to obtain a simple algorithm for polynomial factorization using factorization of its integer values and Lagrange interpolation. The ideas behind this algorithm are due in part to Bernoulli, Schubert, Kronecker. See this answer for references.