is there a difference between E[e|x]=0 and E[e|d=1]-E[e|d=0] in continuous vs discrete case in regressions? in the discrete case, if assignemt is random, then i can express E[y|d=1]-E[y|d=0] = B + E[e|d=1]-E[e|d=0], where the expectation of the errors are the same for both groups and become zero. Where I am confused is for a linear regression/continuous variable, we say this condition is expressed by E[e|x]=0, and I struggle to see how they are the same. its not the same as saying E[e|d]=0, right?

If I take a partial derivative of E[y|x] wrt x, I get B+ dE[e|x]/dx. cant I have this last term be zero without having E[e|x]=0? is E[e|x1,x2]=E[e|x2] the same thing as E[e|x]=0
It is very unclear what you are asking. But in most regressions it is assumed that the error term (I assume "e" is the error term) is assumed to be iid for all values of x. In particular, in the discrete case $E[\epsilon|d=1]=E[\epsilon|d=0]$, but this can be generalized by saying $E[\epsilon|x]=E[\epsilon|x']$ for all $x, x'$. Now if your regression also includes a constant term, it is without loss of generality to assume that the expected value of $\epsilon$ (which is the same for all values of x) is equal to zero. Thus, the importance of the assumption $E[\epsilon|x]=0$ is not so much the "equal to zero" part, but the fact that is the same for all values of x.