The relationship between A and B cuts both ways
cut both ways - Having a mixed effect, to have advantages and disadvantages; to have two different effects at the same time, usually one good and one bad; To have both favorable and unfavorable results or implications; to affect both sides of an issue equally; to work both ways
e.g. The Internet cuts both ways – it not only opens borders, it draws boundaries between the people who have it and those who do not.
You could also say (as @Graffito did), "A and B are ambivalent toward one another"
Ambivalent - Having mixed feelings or contradictory ideas about something or someone
Citations from the Oxford Dictionary and The Free Dictionary Idioms