Is there is any possibilities to change default moodle quiz code.If yes, then will it affect my functionality
If you mean the underlying PHP and Javascript then yes you can do whatever you want with it. If you change it in such a way to change it's functionality then, yes it will change its functionality.
Your question seems strange seems to be the equivalent of "I have a car, is it possible to modify it will it change the way my car works", so please explain further if I have mis-understood. Perhaps your Moodle is hosted by another organisation and your question is related to that?