The NAND gate is considered to be the universal gate because all other gates can be realized by using this gate.
If two input leads of a NAND gate are shorted together, the resulting gate is a NOT gate. Here, A = B.
The AND gate can be realized by using two NAND gates. The output of one NAND gate is inverted by the second NAND gate used as NOT gate. The combination acts as an AND gate.
The OR gate can be realized by using three NAND gates. Two NAND gates are connected as inverters and their outputs are fed to the two inputs of a NAND gate. The combination acts as an OR gate.