They can, and it is a defence mechanism. If a predator grabs a gerbil by the tail in the wild, the skin can slip off and the animal escapes — better to lose a tail than a life.
The tail does not grow back, though, so this is an injury rather than a party trick. Never pick a gerbil up by the tail, and if it happens, get the animal to a vet, because the exposed area is prone to infection.