Whose neighbours are hostile?
APL (Dyalog), 17 bytes
1=⊢∨(×/∘,↓)⌺3 3÷⊢

Try it online! (credits to ngn for translating the test cases to APL)
Brief explanation
(×/∘,↓)⌺3 3 gets the product of each element with its neighbours.
Then I divide by the argument ÷⊢, so that each entry in the matrix has been mapped to the product of its neighbors.
Finally I take the gcd of the argument with this matrix ⊢∨, and check for equality with 1, 1=
Note, as with ngn's answer, this fails for some inputs due to a bug in the interpreter.