How can a coinbase transaction be created and what would happen if there was more than one coinbase transaction in a block?
The current bitcoin system does not allow to create a block with two coinbase transactions. The rules are described here. So a player against the system would need to craft such a block manually, which would get rejected, and eventually the node would get banned.
Hint: as his is a basic question of how bitcoin works, I recommend to read the technical articles on bitcoin.org, as well as the article on protocol specification in the link. And on top Andreas‘ book „Mastering Bitcoin“ gives a deep insight into the bitcoin world. It is also online available, in many languages. Highly recommended!
Coinbase Transactoin is created after new block is minned in blockchain. Its the first transaction happen in any block and the transaction is minning reward(12.5 btc+fee) as per now. When new block is minned particular amount of bitcoin is generated as minning reward and to make those btc come in existance it need to be assigned to some address. That address is generated within the block and minning reward is stored on that address which is known as coinbase transaction.