We present C and O abundances in the Magellanic Clouds derived from deep spectra of HII regions. The data have been taken with the Ultraviolet-Visual Echelle Spectrograph at the 8.2-m VLT. The sample comprises 5 HII regions in the Large Magellanic Cloud (LMC) and 4 in the Small Magellanic Cloud (SMC). We measure pure recombination lines (RLs) of CII and OII in all the objects, permitting to derive the abundance discrepancy factors (ADFs) for O^2+, as well as their O/H, C/H and C/O ratios. We compare the ADFs with those of other HII regions in different galaxies. The results suggest a possible metallicity dependence of the ADF for the low-metallicity objects, but more uncertain for high-metallicity objects. We compare nebular and B-type stellar abundances and we find that the stellar abundances agree better with the nebular ones derived from collisionally excited lines (CELs). Comparing these results with other galaxies we observe that stellar abundances seem to agree better with the nebular ones derived from CELs in low-metallicity environments and from RLs in high-metallicity environments. The C/H, O/H and C/O ratios show almost flat radial gradients, in contrast with the spiral galaxies where such gradients are negative. We explore the chemical evolution analysing C/O vs. O/H and comparing with the results of HII regions in other galaxies. The LMC seems to show a similar chemical evolution to the external zones of small spiral galaxies and the SMC behaves as a typical star-forming dwarf galaxy.