Single photon or biphoton states propagating in optical bers or in free space are affected by random perturbations or imperfections along optical bers or free space that disturb the information encoded in such states and accordingly quantum key distribution is prevented. We propose three different systems for autocompensating such random perturbations and imperfections when a measurement-device-independent protocol is used. These systems correspond to different optical bers intended for space division multiplexing and supporting collinear modes, polarization modes or codirectional modes such as few-mode optical bers and multicore optical bers. Accordingly, we propose different Bell-states measurement devices. Finally, these types of optical bers allow the use of several transmission channels what compensates the reduction of the bit rate due to losses.