Is it allowed to have a sexual relationship between a Professor and a graduate student?
This depends on the university's rules. Pretty much every plausible set of rules you can think of is used somewhere: everything is allowed (well, generally not explicitly, but by not having rules for this at all), nothing is allowed, it's allowed only if they are in different departments, it's allowed only if the professor is not teaching or supervising the student, etc. If this issue is relevant to your life, then you need to figure out which rules apply.
On the other hand, I'd say it's always a bad idea if the student and professor are in the same department or even related fields, regardless of whether the university's rules allow it. You could have a secret relationship, but it's wise to avoid awkward or troublesome secrets in your professional life (and all the problems of a known relationship will be magnified if you are discovered in a secret relationship). On the other hand, if other people in your department are aware of your romantic involvement, then it is almost certain to lead to complications. For example, the student will eventually need letters of recommendation, some of which will be written by colleagues of the professor. If they write honest letters, can they feel confident that what they wrote won't make it back to the professor? Probably not, so they will feel constrained in what they write. People reading the letters will realize this, so nothing positive will be taken quite as seriously. And letters of recommendation are just one issue - the relationship will keep coming up in different areas.
When you take into account all the important points made in other answers (power differentials, what happens if the relationship ends, improper appearances and effects on reputation, etc.), it's not hard to see why there are often rules against this.