There are laws around elections and referenda: the various Representation of the People Acts cover most of them, though there are others.
The body that oversees elections is the Electoral Commission, which has a statutory duty to give advice and set up rules for elections, and may impose civil financial penalties (not, legally speaking, "fines" though universally referred to as such) on parties who break electoral law, though it has no power to make laws of its own. The Vote Leave campaign was recently so fined for conduct during the EU referendum and appealed to the High Court; the Court, on a preliminary issue, found that the Commission gave mistaken advice on the point, which effectively advised all parties to break the law. Where this leaves the Commission (and the fine) is currently unclear.
Probably the best way to think of it is that the Electoral Commission is the policeman who can stop you when speeding, and either caution you or give you a ticket. If, however, you dispute his belief that you were going too fast (or if, having been told you can safely travel at 34 on this road, you get a ticket from a speed camera), only a court can properly decide whether you were breaking the law.