Yes, in most cases you can search and book a room for the same night, and it is one of the more common things agents use a hotel booking API for. You put today as the check in date and the next day, or a later one, as the check out. What comes back depends on what the suppliers still have open at that moment, so the list may be shorter than it would be for a stay next month, and the better value rooms are often the first to go.
The thing to watch is the hotel cut off time. Many hotels stop accepting new online bookings at a certain point in the evening, in local hotel time rather than your office time. After that point a property may drop out of the results altogether, or it may still appear and then come back as unavailable when you try to confirm. Some suppliers also treat late same day requests as on request rather than instant, which means you wait for the hotel to reply instead of getting a confirmation straight away. That is decided by the supplier and the hotel, not by the software.
For a customer who needs a bed tonight, the safest approach is to pay at the time of booking where the rate allows it, take the confirmation number, and send the voucher to the customer's phone before they leave your desk. If a booking comes back as on request, tell the customer plainly that it is not confirmed yet and keep a second option ready.
Next time you take a late booking, note the time you searched and whether it confirmed straight away, so you learn where the practical cut off sits for the hotels you sell most.