Do I need a rectangular pool to do laps?

No. All pools will have a “center line” so one can do laps in a freeform shaped pool just as easily as in a rectangular pool. Depending upon one’s preferences, the length and depth will likely be more important than the shape. If flip-turns are required than the lap depths at the ends will need to be deeper than normal. Avoid putting stairs in the lap lane as well. Most people do not need to do a flip turn on both ends so a standard pool with standard depths, as long as it is “long enough” to supply an adequate lap lane for the user, is just fine.