Section 18(1) of the Prosecution of Offences Act 1985 (UK) provides:
(a) any person is convicted of an offence before a magistrates’ court;
(c) any person is convicted of an offence before the Crown Court;
the court may make such as order as to the costs to be paid by the accused to the prosecutor as it considers just and reasonable.
In Balshaw v CPS  EWCA Crim 470 the Court of Appeal (Criminal Division) held that section meant Andrew Balshaw could be ordered to pay £13 600 for an accountancy report commissioned by the Economic Crime Unit of the Thames Valley Police.
As long as the order didn’t create a windfall for the prosecution, or amount to a tax or fine in disguise, it was just and reasonable to reimburse the police for the cost of preparing material for use at court.
But it seems that the Courts still distinguish between the costs of an investigation and a prosecution, and it is only the latter that might be compensable.