Self trade prevention I've read recently following on GDAX:


  You cannot trade with yourself on GDAX. If you create a buy or sell
  order for the same price as another matching order then they will
  cancel each other out.


I want to know is it a default protection practice, used all over the exchanges or only a GDAX innovation?
What about stock markets and other legal trading platforms. Do they also implement this?
Trading with oneself is commonly known as wash trading and is most commonly used to manipulate markets.


  I want to know is it a default protection practice, used all over the exchanges or only a GDAX innovation?


Other exchanges implement this feature. To discourage wash trading, some exchanges will cancel orders that wash, yet still charge commissions for the orders, despite the trades never hitting the market (showing on tickers, trade history or charts)


  What about stock markets and other legal trading platforms. Do they also implement this?


I will ignore the implication that bitcoin exchanges are not legal exchanges. 


  used all over the exchanges or only a GDAX innovation?


NYSE/Euronext-Liffe and Eurex do not implement STPM (self-trade protection mechanism). However it's against exchange rules and you will receive nasty letters and/or fines, suspensions or bans for repeat offences.

ICE (Intercontinental Exchange) whose most popular products are oil futures are an example of a well established exchange that implements STPM.

A common use of wash-trading is to trigger stops, especially during periods of low liquidity.

Overall, wash trading is a nefarious activity and I don't know of a legitimate reason you would want to do it, hence exchanges attempt to obstruct traders engaging in the activity.

Defeating STPMs seems a trivial problem (traders can operate multiple accounts) or get their buddy to high/low tick something for them.  STPM can also be defeated in software.  Some trading software even has built in functionality for this, allowing traders to specify that orders should be pulled before when an order is submitted that would wash.