debounce problem

But that counter is advanced by timer0 ISR

That is not correct. The counter (TMR0) is advanced by hardware.

Based on wiring.c, delay utilizes micros(), which tests TMR0 interrupt flag. So from that perspective, using delay() within isr is OK.

micros() interestingly disables global interrupt upon entry but never re-enable it upon exit.