Evolution of Fano resonances in two- and three dimensional semiconductors with a magnetic fiel