Wikipedia has a good example, pairwise averaging: AVG(x,y) = (x+y)/2. AVG(1,AVG(3,2)) != AVG(AVG(1,3),2)
I came up with another silly example, "base ten digit matching", where M(x,y)=0 in each digit where x and y match, 1 in each digit where they disagree. 11 = M(000,M(222,234)) != M(M(000,222),234) = 111. You can probably come up with more examples along this line where your result is in a restricted subset of your arguments.
Here's a poker example! For two poker hands, select the least powerful hand that beats both of them, using only unused cards from the standard 52-card deck. (That is, your resulting hand cannot contain any of the cards used in the arguments.) Call this function PB. Imagine some suit ranking and a special no-such-hand value to make the function well-defined.
PB(22223, 44445) = 66663
PB(66663, AAAAJ) = a J-high straight flush
PB(44445, AAAAJ) = a 9-high straight flush
PB(22223, 9-high straight flush) = a T-high straight flush
PB( PB(22223, 44445), AAAAJ ) = a J-high straight flush
PB( 22223, PB(44445, AAAAJ) ) = a T-high straight flush