after my 12 can I go abroad for my graduation and then come back and give UPSC
For UPSC CSE you need to have a undergraduate degree in order to be eligible for the examination. In the official notification of UPSC CSE for any of the years, there are no such restrictions available. As a result, you can go abroad for Graduation and still can be a civil servant provided you are a citizen of India.
To know more about UPSC CSE visit the link below:
https://competition.careers360.com/exams/upsc-civil-services-exam
I hope this answer helps. All the very best for your future endeavors!