Yes, then again it is a movie, indeed. But Nolan does strive to color within the lines. My guess here is, if the Joker is indeed in police custody, they would not knowingly release him to a vigilante to do with as he wishes. Doing so would make the cops legally liable for whatever Batman does with the guy. That would be unacceptable even in a corrupt police force. Therefore, let's say the police have indeed captured Joker, but they "lose" him for a while on his way to processing. Maybe Gordon goes out on a limb and enables Batman to get hold of Joker before the formal process begins. Maybe Joker is ushered into a room where Gordon knows Batman is hiding, and Gordon tells the attending officers to go get some coffee. In fact, if it happened this way, it would have to be Gordon who did it, because it would have to be someone with some authority who was willing to work with the Batman.
Or maybe Batman is lying in wait in a police interrogation room and none of the cops know he is there. In which case, he barricades the room, energetically questions Joker, and then exits through some air duct, skylight, or something along those lines. That could be an interesting scene, Batman working the Joker over with the cops looking to bust in.