You can still learn. What matters is which lesson, and four questions to ask before you pay.
Most people who book a first surf lesson are worse swimmers than they admit to the person taking the booking. It is the single most common thing not said, and it is worth saying, because the honest answer is better than you probably expect.
A beginner lesson is not swimming. It happens in whitewater — the broken, foaming water inside the breakers — in depth you can stand up in. You lie on a soft foam board roughly two and a half metres long, which is a very large flotation device, and you are attached to it by a leash at the ankle. An instructor is in the water with you, not on the beach. For a weak swimmer, supervised whitewater on a foam board is one of the safer ways to be in the sea, and considerably safer than a swim off the same beach on the same day.
The board is the reason, and the board is also the catch. The flotation is doing the work, which is fine right up until it is not there — a leash snaps, or you fall on the wrong side of the board and it goes in without you. That is a nuisance in standing depth and a serious problem past it. So the question that matters is not "can I swim?" but "can I swim in these conditions, without the board?" — and in a beginner lesson the answer is allowed to be no, because you are not going anywhere you cannot stand.
Scuba will test you. Surf will not. That asymmetry is the danger. To certify as an open-water diver you have to swim 200 metres — or 300 in mask, fins and snorkel — with no time limit and any stroke you like, and float or tread water for ten minutes by any method that works. It is a real assessment and people do fail it, and it can also be trained for in a few months, so it is a delay rather than a door closing. Adaptive routes exist and are used: people with paraplegia and amputations hold this certification.
Nobody will ask you anything before a surf lesson. There is no test, no minimum, and in most of the world no licence behind the person teaching you. Which means the checking is yours to do.
The four questions
"What water-rescue qualification does my instructor hold?" This is the one that matters and it is genuinely checkable. Both the International Surfing Association and Surfing England require a current lifesaving or beach-lifeguard award before anyone can hold their instructor certification — Surfing England recognises beach lifeguard awards specifically. A school whose instructors carry those will tell you which, immediately. Hesitation is your answer.
"How many people per instructor?" Ask for the number, not a reassurance. In whitewater a single instructor is watching every person in their group at once, and the number is the whole of how closely you are being watched.
"Will the lesson stay in standing depth?" For a first lesson it should. If the answer is that it depends on conditions, ask what happens when conditions change — a good school will already have an answer, because they have had that day.
"I am not a confident swimmer. Is that a problem?" Say it out loud, at booking, not in the water. A good instructor will put you closer to them, keep you shallower, and think nothing of it — this is an ordinary thing they hear every week. A school that makes you feel awkward for asking has told you something useful for the price of one uncomfortable moment.
Where the answer becomes no
None of the above applies once you are past standing depth without an instructor. Surfing on your own, in a group of friends, or on a day with any size to it is a different activity with a different requirement, and that requirement is being able to swim in those conditions without your board. [Never surf beyond your ability](/surf/school/know-your-limits) is about exactly that step, and [rip currents](/surf/school/rip-currents) are how the step goes wrong.
And on any day, at any level: if the beach has lifeguards, swim and surf between their flags. That is not advice for beginners. It is advice.
Open question: Add the equivalent instructor rescue-award requirement for Australia, the US and France, so this is not only answerable for a reader in the UK.