A general method is presented for calculating the spatial distribution of damage generated by localized implantation in semiconductors. Implantation through masks and focused ion beam implantation in GaAs are simulated and compared to cross-sectional transmission electron microscopy observations. An excellent agreement is obtained when a depth-dependent lateral straggle is considered. Arbitrarily shaped mask edges and different compositions for the mask and the substrate are included in the calculations as well as realistic current profiles of the ion spot in the case of focused ion beam implantations. Simulations and experiments clearly demonstrate the potential application of localized implantations to fabricate lateral quantum nanostructures.