How can we implement server-side hooks, or any similar solution, to restrict git push into git server?
For example, we want to disable push of commits containing *.class files.
I don't think Azure DevOps uses hooks.
You can use Branch Policies to make use of an external validation service (as I understand it this uses web hooks).
Additional: the status of this User Voice request indicates the above is the official answer.
But maybe the simple case would be .gitignore
and code reviews?