In the world's first national referendum on use of nuclear power generation, Austrians voted yesterday to scrap a $530 million facility that was to provide all of the country's electricity.

A bare 50.5 percent of the voters rejected the already completed station in what Chancellor Bruno Kreisky called "a shocking defeat" for his Socialist government. A yes vote would have authorized the plant to start operating.

In campaigning for acceptance of the facility, 18 miles northwest of the capital, Kreisky, 66, had said he might resign if the voters turned it down. He called a meeting of his party leaders today and said, "I do not exclude my resignation but I will not comment before consulting the party."

About 64 percent of the 5 million eligible voters turned out in Austria's first referendum since World War II. The result was not binding constitutionally but Kreisky said it will be respected despite the narrow margin.

Many members of Kreisky's party, including his son Peter, 35, joined the antinuclear effort. The conservative opposition People's party split on the plant, with its leadership opposing it on safety grounds. The plant, under construction for seven years, could be abandoned or converted at great cost to use with coal or oil fuel.