Dogs, who will do anything to please the folks on the other end of the leash, proved it Saturday in Pacifica by jumping onto surfboards and attempting, much as humans do, not to fall off.

It was the best show in town, and it was free. Hundreds of people who had never before seen a dog ride a surfboard — along with one whale, who lingered offshore and watched from a respectful distance — showed up to witness the miracle.

“How often do you get a chance to see a dog ride a surfboard?” said spectator Toshio Hirano, which is the sort of question that answers itself.

It was billed as the second annual World Dog Surfing Championships. Linda Mar State Beach was full of people and dogs, and many of the dogs were wearing sunglasses, wetsuits, clothing and fancy hairdos, it being that sort of occasion.

Unlike humans, dogs don’t perform tricks or fancy maneuvers on a surfboard. They’re judged pretty much on how long they manage to remain on the board, and that comes down to wave selection.

And their humans are the ones who do that part. Pick too big a wave, and the dog falls off the board right away. Pick too small a wave, and the ride ends before the dog makes it to the beach. As with most things in the human-dog dynamic, the humans deserve the blame when the dog fails to do what it’s supposed to.

In the first heat, Samson the spaniel was facing off against two other dogs. On his first ride, his master, Don Horn of Orinda, set him off on a wave with too much oomph. Unable to hang 20, Samson wiped out after three seconds.

Like all great competitors, Samson brushed it off, got back on the board and rode the next wave all the way to the sand. The crowd cheered as if watching the Giants during a season besides this one.

“Arf,” said Samson.

Samson earned an impressive 9.3 on judge Sam Stahl’s scorecard.

“It’s subjective,” Stahl said, describing the challenge of dog surfing evaluation. “”It’s a feeling. You’re looking for ability to stand, ride, move in the wave. You’re looking for style. How panicked or how calm the dog is. That makes a difference.”

While Samson surfed, other dogs waited on the beach, sniffing out the competition. Derby, one of the competitors, was wearing sunglasses and a blue Mohawk.

“I told him he’d look stupid but he didn’t care,” said his owner, Kentucky Gallahue of San Diego. “He’s a laid-back dog. Nothing bothers him.”

Three dozen dogs were entered in the contest, about five times as many as last year. Dog surfing is catching on, promoters say. There are contests all over Southern California, each claiming to be a world championship. Humans can be as bewildering a species as dogs.

Last year’s Pacifica champion, Abbie the Australian Kelpie, was lying quietly on the sand, awaiting her turn. Her owner, Michael Uy of San Diego, said Abbie is a veteran of many competitions and takes things in stride.

“You want a dog to be mellow,” Uy said. “I never grab her and put her on the board. I wait for her to get on by herself.”

With so many dog lovers at hand, it was a good day to sell stuff. At least a dozen vendors set up tables on the beach, hawking dog food, leashes, organic stain removers and high-end chew toys that come with safety indicators to show if the dog has chewed too much.

Lorraine Walston was selling her homemade dog socks for $30. If that sounds like a lot for socks, she said, remember you get not two socks but four socks in a set of dog socks.

Scott Harlan was selling a $30 nylon sack that attaches to a leash and is intended to hold those little plastic bags after the dog has done what dogs tend to do. When you get to a trash can, you activate a small black switch and the doggie bag drops from the nylon sack into the trash.

“How about that?” said Harlan.

Also on hand were volunteers from the Peninsula Humane Society. They were encouraging passersby to adopt dogs but they did not bring with them any dogs to adopt. Volunteer Meghan Lloyd said that was because the society wanted folks to “make an informed, mature decision” about dog adoption, and a dog surfing contest might not be the sort of place to do that.

On the beach, the fans were delighted and did not appear eager to leave, although the whale departed after a short visit. One of the dogs was to be the champion while the others would not, although the judges — taking a cue from the competitors — were still scratching their heads over the matter at press time.

Steve Rubenstein is a San Francisco Chronicle staff writer. Email: srubenstein@sfchronicle.com Twitter: @SteveRubeSF