Hi Aspirant,
Yes, a student pursuing law can appear for UPSC. The eligibility criteria of UPSC suggests that one should have minimum of graduation degree(Bachelor's degree like BCA,LLB,BCom,etc) of education qualification to appear for UPSC. Also it is said that law students have an edge over other UPSC aspirants in some subjects since they have better knowledge of laws making it to top in some parts for IAS,IAS,etc.
For more information on UPSC and other more eligibility criteria refer the link below,
https://competition.careers360.com/articles/upsc-ias-eligibility-criteria
Hope this helps.
Good luck!!!
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile