Yes, this is a common feature on many SMS apps, especially third-party apps, and if the built-in app doesn't do what you want you should not settle for it (there's nothing special about a manufacturer's SMS app).
I don't use this feature, but as examples Textra (my current default SMS app) lets you set a maximum number of messages to keep (per conversation, separate limits for SMS and MMS), while QKSMS (which I used recently) lets you auto-delete messages above a certain age. The stock app on my phone (Google's Messages app) does not have this feature, but having few options is typical for Google apps (one reason I replace almost all of them).