To play with fire means to take on a matter with little knowledge of it and which will therefore be liable to cause trouble.
1. The riots in the stands should be a warning to the game's organizers that they are playing with fire when they do not provide proper security measures.
2. It was obvious that Karthikeyan was playing with fire when he took over the responsibility of the construction work.