I have had this happen a couple times, and my first thought was "that is really dumb". To send all your workers at the start of the game doesn't seem to have any hope of winning. At best, you will kill one enemy but be left so vulnerable to any rushes that it won't matter. So, take advantage of that. I haven't ever seen this in a 1v1 but I similarly think that it has almost no hope of winning.
The idea here is that they sacrificed their entire economy for an attack. In a case where your enemy's economy is suffering, the principle is to stay alive as long as possible so your economic advantage will be effective, but don't wait so long that they can recover economically. In a 2v2, you have the advantage that one of you can almost die while the other builds an army.
Keep as much alive as possible for as long as possible, until your ally can come with attacking units. Don't bother trying to attack them, just run around and keep them busy. Don't even bother too much trying to mine while they're chasing you. While the enemy is picking off a few of your workers, your ally will be building an army. If it helps, send all your own resources to your ally so he can make attacking units as fast as possible. You will have a huge advantage because you have one player with full economy, so he should be able to clean up the enemy workers (or just keep them busy), and send a couple units to the enemy's certainly-empty bases to prevent any worker creation.
Your ally should keep in mind that the opponents may change their minds and start attacking him instead, since you are just running them around doing very little damage. Walling in with unfinished supply depots and barracks can help get a wall up faster. Or blocking access to the mineral line with pylons / gateway.
Keep them running around, and you will have an army before your enemy for sure.