Yes, once in your lifetime, and it must be a direct trustee-to-trustee transfer. This is called a qualified HSA funding distribution.
A qualified HSA funding distribution from an IRA counts toward that year’s contribution limit, so you cannot move more than you would otherwise be allowed to contribute.
You must stay HSA-eligible for 12 months afterward or the amount becomes taxable.
401(k) money cannot be moved into an HSA.