PIR Sensor output to firebase

Your first problem is on accurately counting the number of people passing. I would say it is near impossible using a PIR.
How would you know if it was activated by one person or two people or a group?
How would you know if they were entering or leaving the corridor?
What happens if somebody turns round and goes back?

You cannot run a database on an Arduino but the Arduino can make use of sensors and communicate back results using WiFi, Ethernet or Serial links.

So you need to say what software the "firebase database" is and what is it running on.