laser module + laser receiver

We will install a laser kit in a gate to count how many cows get in a barn. Cows can get in or out at any moment. At the same time a sketch is running time scheduled operating fans and waterpump. Is it possible to run a time scheduled sketch millis() structured that commands a fan and a waterpump while uses interrupts to count beam laser changes?

That's possible, of course. Interrupts and time based operation fit together very well. But before you dig into details, try to specify more precisely how the cows are counted, i.e. how to detect whether they go in or out, and what should happen at a certain time or intervals.