I was going to mention that you are allowed to build right up to the boundary (in England) but Sphinx beat me to it. But I will say that jake-the-peg mentions a fire hazard. I've recently had planning permission granted and as a result of this I know that you are allowed to build right up to the boundary as long as you don't have openings in the wall which would allow fire to spread to a neighbouring property. There are certain specified sizes which require greater distance between buildings, for instance, up to a total of 1m2 must be no closer than 1m to the boundary.