Can I change lesson activity`s code in away that use ajax on clicking on next page button in content page of lesson?
Yes - I'm sure you can. All of Moodle is open source, so you are welcome to change it in any way you want.
If you're asking whether there is a quick 2-line change that will do that, then the answer is no; it sounds like a fairly major development project.
This is a great IDEA !!!
It would be great If there was an available mechanism to do this in moodle.
I understand It will be hard to develop , but I am going to ask you to at least give an explanation of how to do this, maybe someone could do that.
Thanks in advance.