"I KNOW THOUSANDS of jokes. I can't get them out of my mind," says Ralph Allen, who hatched the idea of "Sugar Babies," that lavish burlesque-show-cum joke-book opening Thursday in the Kennedy Center Opera House.

"There's the guy who says, 'I had to shoot my dog last night.' 'Was he Mad?' 'Well, he certainly didn't enjoy it.' "

(This man has a Phi Beta Kappa key.)

"I like the one in the schoolroom scene in 'Sugar Babies.' The teacher asks, 'What's the difference between prose and poetry?' and the comic says, 'Oh that's easy, pros stand on the corner.' "

(This man once delivered recondite papers on "The Eidophusikon" and "The Shakespearean Productions of Kemble and Capon.")

"Or the beautiful chorus girl who says, 'I'm going to stand on my head or bust.' And the comic says, 'You'll get better balance on your head.' "

(This man had a Guggenheim fellowship.)

"Milton Berle told me this one . . . " Allen, Doctor Allen to the students he once taught, is onto a largely unprintable saga about a proctologist and an unorthodox use of tea leaves. And he's chortling all the way.

Ralph Allen says he still sees himself as "a theater academic," his profession for 20 years, until "Sugar Babies" made him a relatively wealthy man and provided him with a passport out of the University of Tennessee, Knoxville. In January 1981 he was hired as a theatrical consultant at the Kennedy Center, where he is generally expected to take the pressure off chairman Roger Stevens and is specifically entrusted with the nuts and bolts of the six-play season the center is coproducing in the Eisenhower with CBS-TV.

Although Stevens calls the shots, he is what the trade calls a "hands-off" producer, which is to say he provides the money, but generally leaves the creative personnel to fend for themselves. To Allen falls the day-to-day supervision. For better or worse, he has had as much to do as anyone else at the Center with the fortunes of such shows as "The Physicists," "Medea," "Tartuffe" and, currently, "The Dining Room."

"Ralph has turned out to be a real professional, way beyond what I would have thought," says Tom Kendrick, the center's director of operations. "Roger has been known to start with a budget of $500,000 and go to $1 million. Ralph's greatest success is bringing in these productions under budget. Whatever you believe about their artistic worth, I think you have to say they've been pretty attractive. And Ralph has done this in tough times of inflation."

Kendrick, among others, also believes that the 48-year-old Allen exerts a youthful influence on Stevens, who may be one of the best of the old guard producers, but tends to be less versed in the contemporary scene. Stevens has been known, for example, to refer to that famous rock group, "The Rolling Stars."

"Roger is very accessible to me," admits Allen. "He gives me a lot of freedom. We talk at length. But ultimately it's his theater and it's my job to support him. Whatever he asks me to do, I do. Scout a play, negotiate a deal. I cooperated with him on 'The Late Christopher Bean' as best I could, because, frankly, I didn't much like it. He sent me out to Denver in March to try to salvage the book of the pre-Broadway musical 'Colette.' I tinkered with it for four days until he decided to call the whole project off. The job never stops. It's morning, noon and night."

A tone of uncertainty creeps into his voice. "I think he likes me. I hope he does. I'm crazy about him. But you can't tell with Roger. You wait a long time for him to say, 'Good job!' "

"Oh, he's a likable fellow," says Stevens, unaware that little praise has been filtering down. "Very conscientious, bright, rather knowledgeable, desperately eager for people's approval. I suppose he's got a lot to learn, but so does anybody who's going into this league. I'm still learning myself." He pauses. "It's very funny, but Ralph repeats himself. I could understand that if he were my age. It's something you do. But when I say he repeats himself, I don't mean once or twice. I mean all the time. Other than that, he's fine. He works hard."

Ann Miller, whose career was rekindled by "Sugar Babies," offers another perspective. "Ralph is a Rock of Gibraltar. There was a lot of trouble during the making of this show and Ralph was a peacemaker. He'd put his feet on the ground and keep law and order. I admired that. He's always trying out these old jokes. Where he gets them, I don't know. They're all so dirty, so racy. I don't understand them. I really don't. But he's a darling."

For one who confesses that "we all like to be liked and I think I like to be liked more than most people," Allen has found himself on the griddle more than once at the Kennedy Center. Since Stevens hates to be the bearer of bad tidings, one of Allen's first tasks was to inform James Mason and his wife, Clarissa Kaye, that their show, a lamentable comedy entitled "A Partridge in a Pear Tree," would be closing early. Kaye was not Allen's idea of a romantic lead ("She looked as if she should have been torturing Eleanor Powell in a prison movie"), nor did she receive the news in a particularly gracious fashion. Allen's ears still redden at the abuse. More recently, he tilted with actor George Grizzard, whom he had hired for the lead in "Tartuffe." Ten days before the opening, Allen fired him. In the heat of indignation, Grizzard vowed never to act at the Kennedy Center again, as long as Allen remains there.

"I find that episode the most unpleasant of the season," Allen says sadly, "because I really do admire George as an actor and I'd like to be his friend. But at the time I thought it was a thing I had to do. In a complex season of plays in which a lot of volatile persons are involved, it would be foolhardy to think that the experience would be absolutely free of trouble."

Allen can be garrulous and outgoing, but he is also subject to bouts of insecurity, when the doubts descend upon him like sheets of black rain. (Observes a colleague: "Ralph is very up and down. One moment, he's sure the world has gone to hell in a handbasket. The next, it's Mary Poppins time. That's his personality. We all know it around here.") In Washington, he has had to learn to proceed cautiously, put some of his remarks off the record and restrain his natural urge to share a good piece of gossip. While the Kennedy Center was still hammering out the season with CBS, Allen let it be known that Robert Redford and Paul Newman might play the leads in a revival of "What Price Glory?" The announcement hit the newspapers, raising expectations that the center was subsequently obliged to squash when negotiations fell through. The incident rated Allen a severe dressing-down from Kendrick.

"I would say that was a lesson in Washington politics for him," says Kendrick now. "If you don't have Redford and Newman, it's not a good idea to talk about it."

"I was very naive," Allen admits. "I thought I had those guys. The problem with big-time movie stars is that they want to be able to sit around the Polo Lounge and say, 'The Kennedy Center is after me to do a play.' But when it comes time, they do a movie instead. The center has always been half a star theater and half an art theater. There was an awful lot of pressure to build the CBS season subscription with big names. I guess I'm not going to try for them in the future. How many of those household names can act? Anyway, there are only five or six of them who give you a big advance ticket sale --a Liz Taylor or a Katharine Hepburn--and the audiences who come to see them are gossip audiences. They're not really interested in the theater.

"I think your best chance in a situation like this is to build confidence in your audience with the Irene Worths, the Fritz Weavers, and the George Grizzards, who may not guarantee you a cent in advance sales, but who are major actors. We've still got one more play to go "Ghosts," with Liv Ullmann , but I think we've already done a wide range of important works this season, some better than others. We've had six or seven Tony winners on that stage. Truthfully, I'm very proud of that. I think we'll do even better next time."

THE MOST revelatory stories about Ralph Allen are, curiously enough, those he himself tells about his father, a college professor and scholar of Icelandic sagas, who is now deceased. "I loved him a lot. Basically I think he was a cheerful man, but he had a surface gloom," Allen recalls. "I'd come home to see him and he'd say, 'It's a good thing you don't live in Philadelphia any more. The streets aren't safe.' Then he'd run through a whole series of national problems and international problems. And finally, he'd look at me and say, 'What the hell are you so gloomy about?'

"We took seven farewell trips to London. When he got to be 70, he'd say, 'This is going to be the last trip you'll have me.' We were always waving goodbye to Trafalgar Square. I was teaching at the University of Victoria Canada in the early 1970s and my father wanted to take one last trip with me. So he flew out to British Columbia and we drove back to Philadelphia via Death Valley, Las Vegas, El Paso and New Orleans. As we were leaving El Paso one morning, he looked at me with this lugubrious expression he reserved for portentous occasions, and said, 'You know, this is the last time we'll ever be in El Paso together.' I had to pull over to the side of the road, I was laughing so hard. I said, 'You've lived 81 years and this is the first time we've ever been in El Paso together.' "

Sometime, Allen says, he'll write a reminiscence of his father and the way he could compound the catastrophes that waited just around the next bend. "Just as I was about to go off to college," he remembers, "my father announced melodramatically, 'When you flunk out of Amherst, it will be an insupportable disgrace for a college professor. I'll have to move out of the neighborhood, and of course, I won't get my price out of the house.' And pretty soon, I was responsible for the financial ruin of the whole family."

Allen graduated from Amherst summa cum laude, valedictorian of his class.

ACADEMIC THEATER is usually an end unto itself, traditionally separated from the professional theater by a deep gulf of hostility. Much of Allen's career has been spent in hot pursuit of scholarly interests. He wrote his doctoral thesis on an obscure 18th-century scene designer, Phillip De Loutherbourg; translated plays by a 16th-century Spanish dramatist, Lope de Vega; and served for several consecutive years as an officer of the American Society for Theatre Research. The University of Tennessee lured him to Knoxville in 1972 with the promise of running the Clarence Brown Company, a fledgling regional theater on the campus. Allen promptly produced such plays as "Everyman," "The Duchess of Malfi" "Macbeth" and "Turcaret"--high-minded fare, but not exactly the stuff that gets you to Broadway.

In 1974, however, the Kennedy Center had begun looking for an out-of-town tryout house. Stevens had concluded that the center could no longer open its plays cold and that a break-in somewhere else would be advantageous. He settled on The Clarence Brown Theater--near enough to be convenient, but far enough away to be out of gossip's range. Allen soon found himself collaborating on such Kennedy Center productions as "The Headhunters," "Rip Van Winkle" and "Do You Turn Somersaults?" "He seemed to be very with-it and he was eager to come on board with us," says Stevens. "By the time this matter of the CBS plays came up, I'd had a few problems with my heart and I figured someone would have to do the spade work. So I said to Ralph, 'Here's your chance.' "

Some observers believe that it was really the New York success of "Sugar Babies" that tipped the scales in Allen's favor. Not that Stevens liked "Sugar Babies" ("I didn't really dislike it," he says. "But it's not the sort of show I would put on.") Stevens does, however, appreciate a commercial hit as much as the next producer.

For all its popular appeal, that show sprang out of an academic paper on low humor, which Allen delivered in 1977 at a conference of theater historians in New York. Entitled "At My Mother's Knee and Other Low Joints," it reconstructed for the audience a quintessential burlesque show of the 1920s, before sleaze got the upper hand. "Academic papers are usually pretty dry," Allen says, "but I knew I could make an audience of academics laugh. I had them howling with laughter." In the audience, howling, too, was producer Harry Rigby, who told Allen afterward, "We ought to do a show like that."

It took months to raise the $1.4 million budget. Early rehearsals were chaotic. Mickey Rooney, signed as the lead comic, was leery of the material. "I was so nervous about the show during rehearsals," says Allen, "I didn't pay my rent in advance at the hotel. I'd go home in despair every night. At one point, I was so sure it wasn't going to make it, I watched Yankee baseball games on television for three days." The out-of-town tryout, rocky as it was, provided Allen with a crucial education, allowing him to amass the commercial experience and professional contacts that have since served him well at the center.

As the recipient of 2 percent of the weekly gross of "Sugar Babies," now in its third year on Broadway, Allen admits he has more money than he's ever dreamed of. Last year, his quarterly income tax bill alone amounted to more than $41,000. "I made more in the first month and a half 'Sugar Babies' was on Broadway than I did with a theater textbook I wrote that has been a standard for 10 years," he marvels.

Still officially "on leave" from the University of Tennessee, Allen lives, humbly and temporarily enough, in a Washington apartment hotel. But it seems unlikely that he will go back to the classroom. He's putting together a second musical, "Honky Tonk Nights"--similar to "Sugar Babies," except that it traces the evolution of popular black entertainment from the turn of the century to 1917--and a New York opening is targeted for early 1983. His wife, who until recently tended the house, dog and six cats in Knoxville, is in New York with the center's production of "Medea." Under the name of Harriet Nichols, she plays the second woman of Corinth. ("The role is too small to open Allen to charges of nepotism," says a colleague.) Most important, Allen has discovered that he likes "playing for bigger stakes."

"I've lived in the Knoxvilles of the world too long," he sighs. "I don't want to spend the rest of my life in a place where my work isn't noticed. I can't pretend it isn't fun to have a show on Broadway. So many productions were already under way when I came to the center. I'd like to do a full season in the Eisenhower, uninterrupted by other projects. I want to find the plays both Roger and I like. I think I've taken a load off his shoulders. I've hardly had a day off. It's nerve-wracking work. But as long as he's there, I'll stay."

Gloom is creeping up on him.

"He's a great man, he really is. A man of extraordinary achievement. I try to study him to see how he's done it all, because he seems so unprepossessing. As I said, I'm pretty sure he likes me. I feel very protective about him."

A silence.

"I guess he's like a father figure to me."