is it possible to add transaction and its parent to the same block?
Yes, as long as A exists in the mempool when B is submitted, it will be allowed in the mempool, and can be in the same block, see Order of transactions within a block. A transaction with no validthat consumes invalid unspent outputs (UTXOs) will be rejected before it enters the mempool.
If a miner mines a block with a transaction (in this case B) with no valid unspent outputsthat has an invalid input (ie the UTXO it is spending does not exist), the block will be rejected when it is submitted because it is a block with invalid transactions.