Ronald Reagan has asked for a change in federal law to permit the Secret Service to provide immediate protection for his wife, Nancy, so she can start campaigning on her own soon after the Republican National Convention here ends.

The Carter administration agreed today to ask Congress for emergency legislation to provide bodyguards for Mrs. Reagan and for the spouse of the GOP vice presidential candidate, who will be nominated Thursday.

The Democratic-controlled Congress is expected to act swiftly on the request from Secretary of the Treasury G. William Miller, whose department oversees the Secret Service.

By law, Secret Service protection is provided to all major presidential candidates. Their spouses, however, would not be guarded by agents until 60 days before the November election, about the time of the traditional Labor Day start of political campaigns.

As the spouses of the president and vice president, however, Rosalynn Carter and Joan Mondale receive year-round protection.

Under the proposal by the Treasury, the wives or husbands of Republican nominees for the top two offices would be protected starting 120 days before the election. In other words, protection in the future could begin as early as July 4.

The request was made on Reagan's behalf by Ed Meese, his chief of staff, in a July 10 letter to Miller.

On numerous occasions, Nancy Reagan will travel separately from her husband and will be participating in public campaign events on her own, Meese wrote.

A Treasury official said Detroit police were guarding Nancy Reagan during the convention, but added that the Secret Service was preparing so there could be a smooth transition if Congress acts rapidly on the request.