The reason for the exception
"Object reference not set to an instance of an object."
is your dt should be null.
Always check dt is not null and has rows before deleting. Change your code to something like below, so delete is success if the conditions are met and no exception is thrown where there is no data.
DataTable dt = ViewState["dt"] as DataTable;
if(dt != null && dt.Rows.Count > 0)
{
dt.Rows[index].Delete();
}
I hope this gives an idea of what is wrong in your code and helps solve it.