No, you cannot apply for both Retail and HNI categories for an IPO. The PAN number used in the application should be unique in an IPO. If you make two applications using the same PAN number, both applications will be rejected.
Note that if a retail investor applies for more than Rs 2 Lakhs of shares in an IPO, the bid is considered as an HNI bid in the (Non-Institutional Investors) NII category.