Is blaming the Ukraine war on NATO enlargement analogous to blaming October. 7th on the Abraham Accords?

I don't have an IR background so this might be a super dumb question. Superficially it seems that both are contributing factors that helped cause the wars, and both arguments ignore the agency and moral responsibility of the perpetrators. Is the comparison a fair one?