You need to apply for a certificate of residence at the Consulate General of Japan. Can I purchase a JR Pass on the day?
Yes,you can.
You can purchase a JR Pass on the same day AFTER you received the Certificate of Overseas Residence from the consulate general of Japan (NOT BEFORE).