You cannot buy the Index, Futures and Options of Nifty and Bank Nifty are cash settled.
Yes, upon expiry, any profit / loss you make will be credited to / debited from your account.
Eg. If you buy an Option at 100 and it expires at 150, upon expiry 150 * Lot Size will credited to your account.
Now if the same Option expires at 0, you will lose the entire premium paid (Rs. 100 * Lot Size).
Similarly if you Shorted an Option at 100 you immediately recieve Rs. 100 * Lot Size in your account, if this option expires at 0 you get to keep the entire premium you received.
Now if the same Option expires at 150, Rs. 150 * Lot Size will be debited from your account.
Would like to suggest you to read Options module on Varsity, everything has been explained in detail there.