We present experimental data and a comprehensive theoretical model for the self-limiting growth during metalorganic vaporphase epitaxy of AlxGa1-xAs within tetrahedral recesses etched in GaAs(111) B substrates. A self-limiting profile develops during growth, accompanied by Ga segregation, and leads to the formation of quantum dots and vertical quantum wires along the base and central axis of the recesses, respectively. A theoretical model based on reaction-diffusion equations for the precursor kinetics, adatom diffusion and incorporation, on each crystallographic facet composing the template, is formulated: our theory explains, and reproduces with good agreement, all the experimental trends of the self-limiting profile and alloy segregation dependence on material composition and growth temperature. These results represent a promising route toward a reproducible on-demand design of seeded lowdimensional nanostructures grown on any patterned surface.