Legislation to keep 4-year-olds out of Virginia public kindergarten classes appears headed for a close vote in a state Senate committee after passing the House of Delegates by a 3-to-1 margin.

The measure, which would affect an estimated 18,000 children each year, is pitting elementary school teachers, principals and parent-teacher associations against school boards and the state education department.

"It's going to be close," said Richard D. Pulley, chief lobbyist for the Virginia Education Association, of the coming contest in the Senate Education and Health Committee.

Many teachers maintain that the current law, which allows 4-year-olds to enter kindergarten if they turn 5 by Dec. 31, is an experiment that hasn't worked. Since the state decided in 1972 to allow younger children in kindergarten, Pulley said teachers have found that "those who start early, by and large, tend to be in the lower part of the class academically.

"They are not prepared to cope with the kindergarten curriculum. The social adjustment is very difficult for them. Motor skills are not as developed," he says. "They are more easily frustrated . . . and the frustration tends to stay with them at least through the elementary school years."

Only eight of the 27 states that lowered the kindergarten age along with Virginia continue to allow 4-year-olds to enroll, according to Pulley, whose organization represents about 40,000 teachers in Virginia.

The bill, sponsored by Del. James H. Dillard II, a Fairfax County school administrator and a Republican, would reverse the state's action and roll back the age of eligibility by one month a year for three years, beginning in 1986. By the 1988-89 school year, only those children who would turn 5 by Sept. 30 could enroll.

Opponents argue that it would shut out many children who can handle kindergarten and would benefit from it. "Everybody knows that children learn better earlier," argued Del. Dorothy S. McDiarmid (D-Fairfax), chairman of the House Education Committee. "This would mean a year of waiting for a child who may be within a month of 5 years old."

McDiarmid says that if the kindergarten program is really for kindergarteners, and if the schools properly counsel parents not to enroll immature children, as the current law provides, the younger children adapt. Part of the problem, she says, is "so many of the kindergartens have gotten like little first-grades."

The House Monday rejected a proposal to allow local school boards to decide whether to raise the age and approved Dillard's bill by a 75-to-24 vote.

Sen. Frank W. Nolen (D-Augusta), a member of the Senate Education Committee, said today he is one of those who plans to oppose the bill. "I just think we ought to quit changing it," he said. He cited his daughter, who entered kindergarten at age 4 and has achieved all A's through seventh grade, as proof that "some kids can make it."