For tail docking to be legal, the dog must be under 5 days old and a vet has to certify that the dog is likely to be used as a working dog for the purposes of . . .
"(a) law enforcement
(b) activities of Her Majesty's armed forces
(c) emergency rescue
(d) lawful pest control, or
(e) the lawful shooting of animals"
AND
"that the dog is of a type specified for the purposes of this subsection by regulations made by the appropriate national authority"
http://www.legislation.gov.uk/ukpga/2006/45/section/6
Further details, including the relevant breeds, can be found here:
http://www.cdb.org/awa/