This issue is controlled by the municipal zoning regulations for your particular area and may even differ between streets, let alone towns.  Generally there is a 1m gap called for between a pool and any structure, but with structural engineering design this can be relaxed to zero, as it all has to do with the proximity of the foundations of the other structures around the pool. The zoning regulations supplied by your local Council building department would be able to give you guidelines for your area.