You can buy stock options close to expiry if you have sufficient margin in your account. The margin required for holding an open position or buying a stock option increases as the contracts are close to expiry. To know more about the margin required details with respect to stock options as they come close to expiry click on this link.
Can I do intraday trading in stock options?
When does expiry take place for Nifty, Bank Nifty, Sensex, Bankex, and stock option contracts?
What is the margin blocking percentage during the end-of-expiry week for physical settlement of stock option contracts?
When both cash and collateral margins are available, which one is utilized first? What is the order of utilization?