How do we check MCAR, MAR in general? Most of methods of imputations requires either MAR or MCAR. How do we check the assumption on MAR or MCAR in general?
In how to check missing data is missing at random or not?, Turgeon said $H_0:MCAR$ vs $H_1:MAR$ is tested by logistic regression of missingness against covariates. There is no particular reason why one should assume $log(f(M=1|X)/f(M=0|X))$ must take the form of linear function of covariates $X$ where $M$ is missingness indicator function. In general $f(M|X)$'s form is not known.
Why in above situation, one can test by logistic regression?

You can't check the MAR assumption in general.  More precisely, for any observable data distribution there is a complete data distribution and an MAR missingness mechanism that gives precisely that observable data distribution.
If you have variables $(X,Y,Z)$ and you are fitting a model for $(X,Y)$, some people would use MAR to mean that missingness was independent of the missing values conditional on the observed values of just $X$ and $Y$. That is testable in the sense that you can see if missingness is independent of $Z$.
