It is said in the ahkam book that a mosque must have a certain distance from each other to be prayed salat jummah. This applies only to shias mosques or even if sunnis build a mosque close to a shia mosque, it will not permissible to pray salat jummah there?

This applies to Shia mosque where the prayer is prayed in the correct fashion.