As others have said above it's definitely possible, and may or may not be a good idea. But for Sport Pilot training it may be the only option depending on where you are, LSA rentals for training aren't found everywhere.

If you want to take that approach, it's probably best to get at least some instruction first before considering buying a plane; with a little experience you'll have a much better idea of what you want.