One of the main goals of Cosmology is to search for the imprint of primordial gravitational waves in the CMB polarisation field, to probe inflationary theories. One of the obstacles toward the detection of the primordial signal is to extract the B-mode polarisation from astrophysical contaminations. We present a complete analysis of extragalactic foreground contamination due to polarised emission of radio and dusty star-forming galaxies. We update or use up-to-date models that are validated using the most recent measurements. We predict the flux limit (confusion noise) for the future CMB space or balloon experiments (IDS, PIPER, SPIDER, LiteBIRD, PICO), as well as ground-based experiments (C-BASS, NEXT-BASS, QUIJOTE, AdvACTPOL, BICEP3+Keck, BICEPArray, CLASS, SO, SPT3G, S4). Telescope aperture size (and frequency) is the main characteristic impacting the level of confusion noise. Using the flux limits and assuming constant polarisation fractions for radio and dusty galaxies, we compute the B-mode power spectra of the three extragalactic foregrounds (radio source shot noise, dusty galaxy shot noise and clustering), discuss their relative levels and compare their amplitudes to that of the primordial tensor modes parametrized by the tensor-to-scalar ratio r. At the reionization bump (l=5), contamination by extragalactic foregrounds is negligible. At the recombination peak (l=80), while the contamination is much lower than the targeted sensitivity on r for large-aperture telescopes, it is at comparable level for some of the medium- and small-aperture telescope experiments. For example, the contamination is at the level of the 68 per cent confidence level uncertainty on the primordial r for the LiteBIRD and PICO space experiments. Finally we also provide some useful unit conversion factors and give some predictions for the SPICA B-BOP experiment. Abridged