In British courts, the people in the dock with an accused person or persons are usually officers of the Prison Service (who not police officers) or else security guards employed via an agency.
Access to the dock is very often via a staircase from a lower level of the court building where cells are located. When their trial starts, an accused person will be brought from a cell, up the stairs and into the dock, where they will sit on a chair until sentence is imposed.
If the court sitting is a preliminary one, for example to decide if the accused person is to be kept in custody (remanded) until the full trial is over, and this turns out to be the case, or if the trial is over and a custodial sentence has been imposed, then the accused person is led back down the stairs to the cells, and later taken to a prison in a truck with cells.
If, at the end of the trial, the accused person has been found not guilty, or if they have been found (or have pleaded) guilty, but have not received a custodial sentence, then they will still go back down the same staircase, only this time they will be processed for release by the prison officers or security guards.
The accused has not been called 'the prisoner' for a very long time, which makes me think that the words in the question come from an old novel, film, or maybe a historical TV drama. I also think fiction is mainly where judges say 'take him down'.
In case anyone is interested, in British courts (of whichever UK legal system) the judges don't use gavels, lawyers can't leap up and shout 'objection!', and 'prisoners' are not guarded in the dock by bobbies with those tall helmets, all of which I have seen in UK made TV dramas, which the producers clearly tailored for another market.