Is hate meant to be useful in any way? I am pretty confident that the act of hating is bad, no matter the situation/problem you are facing.
Now, does hate have any intrinsic purpose? I am thinking that maybe it was useful to hate in some step in the evolutional chain. Probably as an unconscious triggering method to keep us away of danger.

To what extent is this idea compatible with buddhism?

I am sorry if my question is not precise enough.
Your question is clear. I have not read anything in Buddhism that explicitly states that hate is a survival instinct. This is because Buddhism concerns itself with ending suffering &amp; hate is something that is not peaceful (SN 35.28). 

That said, from an evolutionary perspective, your idea is compatible with the fundamental Buddhist principle of 'cause &amp; effect' (conditionality) since Buddhism studies 'natural law'.

Buddhism explains hate is an underlying tendency (AN 7.11) that exists within the (subconscious) mind/brain from child birth (MN 64) (even before a child can express hate).

Buddhism states hate is a natural element or dhatu (MN 115). 


  The Buddha said that to really know any object, we must know five
  things about it, namely:
  
  (1) What are the characteristics or properties of the object? 
  
  (2) From what does the object arise? 
  
  (3) What is its assāda, its enticing quality, its appeal, its
  allurement? 
  
  (4) What is the ādīnava, the hidden danger, the sinister power to harm
  that lies concealed in it?
  
  (5) What is the nissaraṇa, the trick by means of which we can get the
  better of it? 
  
  Question
  45 page 59