I tried many things like breeding with a donphan with knock off (same egg group) , alpha sapphire move tutor x and y move tutor but my ambipom and aipom won't learn knock off. I don't know what else I can try.
You can't in X & Y, it was only added to it's movepool in ORAS where you can learn it via tutor.
As far as I know, there is no way to obtain knock off for Aipom or Ambipom in X or Y, but you can learn it via Move Tutor in ORAS.