The short answer is that a harness or a dog guard keeping the dog in the back of the vehicle is desirable.Be on the safe side.Although there were rumours that it was to be an offence not to have a dog on a harness, I've never been able to find any Act of Parliament, or regulation made under an Act of Parliament, which says so in terms.
However, a dog which is free to move around inside a car may, obviously, present a risk.It is an offence to use a vehicle on a public road when not in proper control of the vehicle (an offence claimed when a driver was eating a takeaway meal when driving and one which has been extended, specifically, to cover use of mobile phones).You can see how permitting a dog to be free in a car could give rise to such a complaint.It's going to depend on the circumstances of each case whether the dog does bring the consequence of the driver not being in proper control.