This old dog has learned some new tricks.

The world’s first hot dog is making a comeback on Coney Island’s Surf Avenue — and giving Nathan’s Famous a run for its bun.

Exactly 150 years ago, German immigrant Charles Feltman ­invented the hot dog when he stuck a sausage inside a specially made elongated bun and called them “red hots.”

Now Coney Island historian and tour guide Michael Quinn has ­revived Feltman’s name and original recipe and brought them back to the beach.

“Coney Island has come back big time so the timing is right to bring back the original hot dog,” Quinn told The Post at his grilling outpost at 1000 Surf Ave. — the exact spot where Feltman set up shop a century and a half ago, and only two blocks from Nathan’s.

The proximity is fitting, since Quinn hopes to resuscitate the ­rivalry between Feltman and Nathan’s Famous founder Nathan Handwerker a century ago.

Feltman’s invention became an immediate sensation in 1867 and his business ballooned into a destination — considered the largest restaurant in the world.

In 1915, after Feltman’s sons had taken over the restaurant pavilion, Nathan Handwerker got a job as a bun slicer. A few months later, Handwerker set up his own 5-by-8-foot stand, underselling Feltman’s famous dogs by 5 cents.

Handwerker “was very nervous at the time. It was like going up against the ‘Death Star,’ ” Quinn explained. “Feltman was so connected with all the politicians and people in charge.”

The dogfight continued into the 1920s, but once the Great Depression hit, Feltman’s tanked and Nathan’s thrived.

“Nathan sold a cheap version of Feltman’s and catered to poorer people,” Quinn said. Feltman’s family sold the business in 1946 and it eventually shuttered in 1954.

Quinn, born and raised in Coney Island, brought back Feltman’s dogs two years ago and has sold them to Brooklyn butcher shops and opened a small stand on

St. Marks Place. This month, he returned to where it all began.

He sells five different hot dogs, including “The Original” with onions, sauerkraut and spicy brown mustard for $4.25; a chili cheese dog for $7.50; the “Al Capone” with vodka sauce and grated parmesan for $8.50; and a casing-free kid’s dog for $3.75.

The descendants of both Feltman and Handwerker are delighted the dog-eat-dog competition has returned to Coney Island.

Feltman’s great-great-granddaughter, Molly Feltman Edwards, 47, who hopes to help Quinn expand to the West Coast, said, “I’m excited that my great-great-grandfather’s legacy is finally realized.”

Added William Handwerker, 62: “My grandfather used to say to me, ‘Competition is the best thing because it makes you better.’ [He] proved that theory correct.”