You can its just trading contracts like you do with players.
But the Sox didn't trade Guillen. They released him from his contract but had a deal with the Marlins that said if he signed they get the two guys. Its basically trading him away without actually doing it.