How safe is it to have sex during the last week and days before the due date of labor?

Safe. Sex is a normal part of a healthy relationship. Unless told otherwise by your physician, you can participate in sex. As long as you dont do anything out of the ordinary as part of your sexual routine, things should be fine. A good fact to know is that semen can cause contractions and can increase the intensity of your contractions :).
Very safe. Unless you have a problem in which your doctor advised pelvic rest, intercourse is safe near your due date and may also stimulate labor.