The rand() works because & is a bitwise operator, so &1 just takes the least significant bit. Look at the binary for the return value; if the results of rand() are, say, 10,5,3,17,6,4,21 then the LSB for those results are 0,1,1,1,0,0,1.
*T=NULL is an error because you haven't defined *T anywhere. When you create a pointer, you allocate space for the pointer itself but you don't allocate space for what that pointer points to. So when you write to *T, after defining just int **T, you're writing NULL to an unknown location in memory.
So if you do:
THEN you can write to T, *pT and **ppT.