Sex after d&c

When is it safe to have sex after a d&c;? And swim? Also if I do have sex before my next cycle and fall pregnant is it dangerous for the baby?