Are two cops allowed to love each other so have a relationship?

Ma
1

I'm watching swat on netflix and two police officers are making love, one is the guy's boss and it is forbidden to have a relationship is that really the case in America and in Germany? Or is it just in the series

Ki

Not forbidden, but not the same department, one has to be transferred