Can I buy glasses with my tax refund (before filing bankruptcy)?

Yes.

You normally want to receive and spend your tax refund prior to filing bankruptcy.