Can a PhD student write recommendation letter for me under whom I worked?
Everyone can write a recommendation letter for you. So the answer is an absolute yes. Nevertheless, the question now becomes: how strong can a recommendation letter written by a Ph.D. student be in order to have a strong application in order to get accepted? But this is a different story.
You may want to send it in addition to the other recommendation letters.