how to double spend Bitcoin transaction? How it's possible to double spend a transaction if the transaction outputs are already spent? and why these types of attacks are not preventable? 

is it about blockchain sync time between nodes?
Double spending is not possible because there are many miners checking the data independently and then verifying the result against each other.  The first 'spend' that gets put into the blockchain and verified is the only one that can count - if another one comes along, it is ignored.

A simple, and elegant, way to keep double spending impossible.