Conservative nonprofit groups have spent tens of millions of dollars on overtly political advertising this election season, testing the limits of what is legal under campaign rules that restrict how much such groups can spend on advocacy.