The allies were very much aware of the increasing militarization of Japan for decades. And in January 1941 the British and Americans held their first combined staff meeting, for the explicit purpose of planning for an expected Japanese attack. So while some of the details were a surprise, as was the effectiveness the Japanese military. The attacks mostly weren’t.
By mid ‘41 men, planes, guns, and other equipment was being poured into the Philippines as quickly as the US could get them there. Unfortunately McArthur’s plan didn’t anticipate an attack until around March when the “cold” season came to an end. With another 20,000 US troops and an additional 3 months training for the Filipino troops Luzon would have been a vastly tougher nut to crack. Likewise the British were reenforcing Singapore/Malaysia as quickly as possible… given that they were already fighting another war. In fact several thousand men arrived in Singapore just in time to surrender, without ever having fired their rifles. A few days’ or weeks’ notice simply wouldn’t change the basic problems of not enough men or equipment in the theater.
Add on top of this the fact that “Plan Dog” had by then been widely accepted and agreed to by the American and British military, which agreed to a primarily defensive posture against Japan. So even prior to US involvement the basic agreement was to beat on Germany first and simply hold against the Japanese. Which meant that the US was transferring Naval units from the Pacific to the Atlantic in 1941. And of course most Army units were already pre-allocated to the European theater.
They only way the Allies could have slowed the Japanese, would have been to prioritize the Pacific. And that would have had bad effects in North Africa. Stripping out a few divisions would have prevented Crusader and may have given Rommel the opportunity to actually seize Egypt to Suez. Not an easy choice.
On a individual operations level, the Allies could have done better. But not by much. With a few hours notice, Pearl could have been defended far better. Simply getting ammo out of storage and next to the AA batteries, having the army planes ready to fly, recalling the sailors from leave, and having the internal water tight doors closed on the ships would have all vastly reduced US losses and increased Japanese losses. A day’s notice would actually probably been terrible for the US. The fleet would have sortied, and without air cover would have been wiped out in deep water. Probably twice as many men lost and the ships couldn’t have been repaired like most of them eventually were.
Give McArthur a week’s notice, and a better idea what he was facing, and Bataan could have been made a lot less horrific. But the US was always going to be defeated there by the Japanese. The US ran out of time for supplying the islands before they could defend them. And the re-supply lines hadn’t been built up yet. So the US had no way to relieve McArthur.
For the British? Hong Kong was a lost cause. Malaya and Singapore probably could have been held against the initial attack. The British did outnumber the Japanese in that area. But they were green and the Japanese had advantages of internal lines, vastly more aircraft and veteran troops.
The Dutch were in a hopeless situation. They had about 35,000 men and about as many reserves. But aside from a solid core they were always under-trained and under-equipped. And 3 light cruisers and 7 destroyers were never going to be anything more than a speed bump to the Japanese. The only Dutch hope lay with the US or the British.