I know that the game doesn't allow stealing, but a Master Ball doesn't fail, so what would happen?
If you throw a Master Ball at a trainer Pokemon, youll lose your Master Ball.
Source - I accidentaly threw my master ball at a trainer Pokemon, thinking it was wild.