The UK law (currently) allow the police to take DNA and fingerprints from persons who have been arrested for, charged with, or informed they will be reported for a recordable offence and detained in a police station. I.e they do not need to be convicted or charged, merely arrested.
The Home Office Stance on this, is below:
The law also states that the DNA or fingerprints can only be used for the purposes of prevention and detection of crime, the investigation of an offence, the conduct of a prosecution or, since April 2005, for the purposes of identifying a deceased person.
Following arrest for a specific offence it may be decided not to proceed with a case against a person. It may be more difficult to establish whether someone who has had their DNA or fingerprints taken is entirely innocent of any crime. This may be for a number of reasons; it may be determined that they were not involved, or it may be that there is not sufficient evidence to proceed with a case. It is also the case that a number of those charged with an offence may not be proceeded against at court, or may be acquitted by a court. In all of these cases there will be no official ‘sanction disposal’ (conviction, caution or other penalty), but ‘innocence’ is not always clearly established.
From records held on the National DNA Database and Police National Computer we know that from over 3 million people sampled, roughly:
124,000 people have been arrested and not proceeded against for that offence, and 200,000 have been arrested and charged with an offence but have been subsequently acquitted, not proceeded against or the charges have been dropped.
In each of these situations, a number of people have gone on to be linked to further offences:
From those arrested but not proceeded against for a specific offence, more than 2000 people have been linked to over 3000 other crimes, including around 40 murders and 90 rapes. For those arrested and charged but not convicted or otherwise determined to have committed that specific offence around 8500 have been linked to 14,000 other crimes – which include over 100 murders and 100 rapes.
Source: Home Office