Yes. There is no issue with compacting the front end. IMO it is a no brainer. Even if there was a problem in the compaction, it would be no big deal just get a new one. I do not care what people say, but I have never seen a split backend get corrupted. It is the front end that gets corrupted. So that is the thing to worry about compacting and repairing.
Compacting the backend requires a little more deliberate thought. You want to control that more. I cannot say if you should or should not compact on close, it depends on the database. But on the backend you want to make sure to do a database backup first, all users are out of the database and not trying to get in during compaction, compaction verified before users allowed back in.
Bottom line. All front ends get compacted on close. Backend compaction needs to get thought out and usually administrator controlled. Database gets backed up before backend compaction.