Yes, candidates in the final year of their qualifying degree can apply for the UPSC Civil Services Preliminary exam. You must have completed the degree before the mains exam stage and be able to produce proof when asked. The degree must be from a recognised university. Read the official notification for the exact cut-off for producing the degree certificate, since UPSC specifies this every year.