Yes, no problem to defrag on another server. When dismounting the store, it will also apply all the transaction log files to it. After the defrag, you may delete the original database. However, it is perhaps best that you keep a copy of the original database and transaction logs somewhere...