Can PhD students patent their work
There is no generic rule that PhD students can't patent their work. When they do, usually, the university or research institution has rules about who owns the IP of what's being done in their labs. My alma mater had a 3-thirds rule where the student, the supervisor and the institution all held a third of the IP. 

I don't find it particularly surprising that only few students end up patenting their work. Patents are much less useful than good scientific publications when applying for academic positions or grants. It seems normal that the focus is set on the later.

Also relevant: patenting costs money to file and money to maintain. It only makes sense to secure future sales. Students rarely have the funds for this and institutions usually prefer to spend on other things more closely related to their mission. Most of the time the decision not to patent is motivated by the low potential gain vs. costs ratio. 

Universities are usually a bit generous in what they accept to file, but then eventually drop the payments later on if it's evident that the work does not bring any profit.