What are HO and OO scales?
HO is a scale of 1/87 or 3.5mm = 1 foot. OO is a scale of 1/76 or 4mm = 1 foot.
For standard gauge models, ie those that in full size run on 4' 8.5" / 1435mm gauge track the model track has a gauge of 16.5mm for both!
Using mm 1/87 equates to 16.49, ie the track gauges matches the scale. 1/76 however equates to 18.83mm.
The reason for this is historical, technical and simple. HO was developed in Germany in the 1920s, obviously with models based on German locomotives on German railways. When imported to the UK obviously the locos would be based on UK locomotives that run on UK railways.
The problem was that the model motors of the time just fit into the non UK scale models. UK railways operated to a slightly smaller loading gauge than in Germany, and virtually everywhere else. Bodies of UK locomotives to HO scale were too small for the motors. The compromise was to change the scale of UK locomotives to 1/76 so that the motors fit. However the decsion was made to keep the model gauge the same; probably becasue the early models were using the German chassis and motors.
What has to be remembered that at the time of introduction model railways were considered as an expensive toy so scale accuracy was less important than reliable running.
Over time this situation has stuck. Some specialist scratch modellers make much of their own track to a gauge of 18mm, known as EM or 18.83mm known as Proto-4. The 18mm is used as it is about the limit to which many commercial models made to run on 16.5mm gauge can have their whell gauge increased.
There have never been any serious commercial efforts to move British railway modelling to 18mm or 18.83 gauge track. One company did produce British models to HO or 1/87, the technical problem of motor size no linger being a problem. No other manufacturer followed suit so today there is the situation of OO running on a track gauge that is not to scale. In reality it is not a noticeable problem and does not detract from the aethetics of the models. Practically it means OO and HO track is interchangeable. Of course perfectionists might didpute sleeper spacings and the like, but these are really not a problem.
While British commercial model OO scale trains run on track that is not exactly to scale and generally HO models do run on scale model track there are other modelled railways that run on non scale track in HO. Particularly those of Spain where the actual gauge is over 5' or over 1600mm. However models of all Spanish trains seem to use 16.5mm gauge track.