Terminal.app's default "Basic" profile is aware of the system dark mode and reacts when it changes, but no other themes appear to behave that way.
For all other profiles,
thcon controls Terminal.app themes by switching
between two profiles you set up ahead of time. From the Terminal.app Settings
page, create (or import) a pair of profiles and configure them to your
liking. Use the names of those profiles in
Profile name to use in dark mode
Profile name to use in light mode
dark = "Red Sands"
light = "Man Page"