Well, Yes you can. But I wouldn't advise doing that because if you (or your friend) don't know if this is possible, its unlikely he'll be able to follow the process to "root and flash" Stock android on his Z3. Its usually a simple process but with it comes the risk that you can brick your device if you make a mistake and end up with a very expensive paperweight.