Sex when you have your period?

Not sure how to ask this, but out of curiosity, is it ok to have sex when you have you period?