Sex while on period?

Is it safe to have sex during your period? Can you get an infection? My fiancée and I don't mind it but medically wise I would like to know if it's ok.