Can bitcoin transactions be modified during mining
Generally, no. Most transactions contain a digital signature which signs a hash of the transaction. Usually this hash includes the entirety of the transaction, so changing any part of the transaction would invalidate the signature and thus invalidate the entire transaction.

There are some exceptions though. There are some signature hash types which don't include specific parts of the transaction thus allowing output to be changed, inputs to be added, etc. There are also some transaction output types which don't require a signature. However these signature hash types and output types are not created by wallet software. Making them requires you to know exactly what you are doing and either make it by hand or use custom software. The vast majority of users will never need to use or make such transactions.

Whoever told you that transactions can be modified in a block and then the blockchain extended to make that transaction valid is completely wrong. Besides the fact that transactions cannot be changed like this and still be valid, including a transaction in the blockchain does not automatically make it valid. It must be valid to be included, and if it is invalid, the block is invalid and nodes will reject it so it isn't actually added to the blockchain that everyone is following.