In the case of a specific story, you have to ask what makes sense.
In terms of the mandatory 24-hour waiting period between long rests...players can always wander off and go burn the rest of the day foraging, chatting, and otherwise being idle. If they elect to take a long-rest part way through a 'dungeon crawl' make sure you consider exactly what that means for them.
For the number of encounters they can handle in a day, per the DMG, it recommends:
most adventuring parties can handle about six to eight medium or hard encounters in a day. If the adventure had more easy encounters, the adventurers can get through more. If it has more deadly encounters, they can handle fewer. (DMG84)
Remember that this is a guideline. And guidelines tend to be broken on occasion.
So, for the specific case of a published adventure, here are some considerations:
1: Look at the encounters, compare them to the XP Thresholds for encounter difficulty in the DMG. If the single dungeon (in this case, the hatchery) contains a few Easy encounters, then the party can handle it in one day, no problem.
2: Consider what makes sense. The party is raiding a hatchery that is heavily guarded. If they roll through, clear half the hatchery, then pitch a tent in a random back room...they are going to either get ambushed, or the hatchery may be evacuated while they are sitting there wasting the day. Or, at the very least, the hatchery will be on high alert and ready for them when they elect to continue...meaning ambushes, traps, fortifications, etc.
So, here are some possibilities.
First, the module may be intentionally straining your players. This happens sometimes. Forcing players to push through when they are short on resources can sometimes lead to some very creative solutions. Alternately, your players might just be burning through resources faster than they should....you really shouldn't be wasting spell slots when a pair of kobolds attacks you. If your players find themselves running short on resources, but still running into encounters, they are likely to become more conservative with their power.
Second, if necessary, allow your players to waste the rest of the day so they can take a long rest. But...consider the ramifications of them doing so. At the very least, they will put the place they are attacking on high-alert. Surprising enemies will become impossible, and I would expect the enemies to dig in and fortify their positions. They might set up ambushes ahead of the players. Or, they might decide that this location is a lost cause, and sneak out. Whatever the case may be, make sure your players know that taking a nap in the middle of an assault is probably not the best plan ever.
So, to give the general gist of it...
Yes, players can always choose to waste the rest of the day so that they can take a long rest. But you have to consider how the NPCs will respond to having a full day to discover what has been happening in their lair.