Yes, you may direct part or all of your refund to apply as a contribution for the prior year to your individual retirement account (IRA) on Form 8888. According to the instructions for Form 8606 (2023), if you are eligible to make a contribution to an IRA for 2023 and you want to apply part or all of your refund as a contribution to your IRA, you can use Form 8888, Allocation of Refund (Including Savings Bond Purchases), to direct the IRS to make the contribution for you. This means that you can allocate your refund (or part of your refund) to an IRA for the prior year by completing and attaching Form 8888 to your tax return.
Sources:
Instructions for Form 8930 (2012)
Instructions for Form 8606 (2023)
Instructions for Form 8889 (2023)
Instructions for Form 1040-NR-EZ (2019)
1040 (2023)
Instructions for Form 1040-SS (2023)
Instructions for Forms 1099-R and 5498 (2023)