Yes - the rules of the road are based on The Highway Code. In relation to the Theory Test - it is a test of your knowledge of the rules of the road.
However, if reading Highway Code seems like a chore. It might be helpful to buy a Theory Test multiple choice book. That way you can refer to the Highway Code for the questions you get wrong or aren't sure about.