Yep. You can buy it for cash and do wtf you wanna do with it. If you take out a mortgage to purchase, you will have to disclose to the mortgage company what your intentions are, which usually means a higher percentage down payment because it would be considered an investment property.
All HUD means is the government secured the previous loan on the property and the buyer defaulted so they foreclosed. Thats how it became a HUD property.
the problem you will have is when you try to sell it to a non cash buyer. most lenders want at least 60 day title seasoning in order to finance a purchase