Nearly 300 demonstrators were arrested yesterday after they climbed a 6-foot barbed wire fence and gathered on a grassy knoll inside the Trident nuclear submarine base to protest international nuclear weaponry.

The demonstrators, holding a United Nations flag and singing "We Shall Overcome," said they were trying to draw attention to the U.N. General Assembly special session on nuclear disarmament.

The meeting at U.N. headquarters in New York starting today will discuss ways of trimming global arms spending, now nearly $400 billion a year.

This base is scheduled to deliver its first nuclear-armed Trident by spring 1981.

Police estimated 1,000 persons gathered outside the base yesterday morning, and about one-third of them used ladders and rug remnants to scale the fence while the others cheered.

Workers entered at another gate and there was no confrontation.

Some of the demonstrators went limp and had to be dragged to waiting buses by authorities, but there was no violence. The arrested demonstrators were taken to the base gymnasium for processing.

"I think this is just the start of it," said a protest organizer. "Hopefully, what we'll see is a whole lot of actions, but smaller actions, through the summer."

In Groton, Conn., yesterday about 30 demonstrators lined up outside the Electric Boat plant to protest construction of Trident submarines there. One demonstrator was arrested when he refused to leave after carrying a black coffin-shaped box through the gate.