Sex if you’re dilated?

Can you still have sex if you’re 2 cm dilated? I’m 33 weeks and 2 cm dilated and don’t know if it’s safe

Or not ?