An insect hive, or a RimWorld infestation, will spawn in any area below an Overhead Mountain within 30 tiles of a colony structure. Yes, this includes a single piece of wall or a wooden door.
Where do infestations spawn?
Infestations are most threatening in mountain bases, as they can spawn practically anywhere inside your base. They are much less harmful in other bases though, and can be considered as a normal-level threat there.
Can infestations spawn on water Rimworld?
Yeah, it's allowed. It's not broken fictionally and makes a lot of game mechanical sense.