Is there a legal reason or law(s) that prevents the United Kingdom from having another referendum on Brexit?
No. The United Kingdom can hold as many referendums on this subject as it likes, as often as it likes. Obviously there are technicalities and bureaucratic measures that have to be accounted for, and some logistical concerns, but there are no legal restrictions to holding the same referendum after the same referendum again and again.
The main issue with taking another referendum is not so much that they cannot, but rather that it opens the door to being accused of trying again until you get the outcome you want.
Anyone who is loudly in favor of a new referendum can similarly be accused of not wanting to enact the will of the people (i.e. the outcome of the first referendum). You only need a minority of "leave" voters who get offended enough to cause a significant uproar over your so-called undemocratic behavior.
If you ask the people for input, they give you an answer, and then you don't want to follow their answer, what is the point of asking them again? Either you're going to get the same answer (which means the second referendum was pointless), or you're going to get the answer you wanted so you can do the thing (remain in the EU) that you think is better (which means referendums are pointless if you're going to do what you want anyway, instead of listening to the people).
In either case, the second referendum always leads to a situation that suggests that the second referendum is pointless.
In short, the UK currently finds itself in a position where they're headed in a direction that (a significant subset of) people do not want to go, but everyone's apprehensive of changing direction because they don't want the backlash that comes with being the one who proposed changing direction.