Are backlinks necessary for affiliate marketing ?
Backlinks, whether you're talking about owning a blog or website regardless of the niche are necessary. So yes, absolutely whether the conversation is about building them or just having them, backlinks are necessary.
Now, with that said, to add to the context of this question, it's not a good idea to build backlinks that are not relevant. Your affiliate products should drive the relevance of your backlinks. If you're an affiliate for food related products then building backlinks from websites that are food related will certainly help you in your relationship with Google and in your competitive edge with others that are trying to rank for the same attention and keywords that you're trying to go after as well.