I was wondering if it is legal, and also advisable to apply for a PhD position at more than one department in the same university. For e.g. I am interested in representation theory and string theory. So would it be possible to apply to the maths and physics department, or there would be inter-departmental clashes leading to my application being disqualified. I guess the rules would be different. SO what are the rules in US and Europe unis resp.
You have to ask each university.
I don't believe there are any ethical issues with applying to more than one program. Moreover, I think it's rare for graduate admissions committees in different departments to share information about applicants. (In the US, that sharing might even run afoul of FERPA, but interpretations of FERPA vary wildly from one university to the next.)
However, at some universities, it is not possible to apply to more than one department. At my university, for example, all graduate applications go through a central web site that forces each applicant to choose exactly one program. Yes, I think this is stupid.