An Initial Public Offer (IPO) is the raising of fresh money by companies. They will issue shares against the money you pay and you become part owner of the company. But where will you hold these shares? For that you need a demat account. A demat account is like your bank account. Just as you hold money in your bank account, similarly you hold shares and stocks in your demat account. Demat means (dematerialized). This is not like holding share certificates in the old day. Instead, you hold a credit to your demat account. So you do need a demat account to apply for the IPO.
Trading account is for transactions and you do not need a trading account for applying for an IPO. But if you want to the sell the IPO shares then you cannot sell without a trading account. If you applied for 100 shares at Rs.140 and the share listed at Rs.200, then you may want to sell these shares and take your profits. But you cannot sell these shares unless you have a trading account. That is why it is better to open a trading account and demat account when you apply for IPOs.