I was told by my gynae to have sex when I have not dilated at all at wk 39 but I eventually went for a csect cz baby was alr big at 3.8kg. Semen can soften the cervix so u may want to avoid if u have not rched wk 37 at least as it can induce labour.
Nope it is not harmful to have sex in third trimester. Indeed it is very helpful esp if you are near to EDD.