Typically those cases are handled by the City Attorney's office, but the DA can prosecute them. The DA is the default prosecutor for all public offenses and even has limited rights to bring civil actions.
The District Attorney's Office may prosecute any state or municipal law violation within its county. Since Thousand Oaks is within Ventura County, the Ventura County DA's Office could prosecute city code violations. While it is true that many large cities have a City Attorney's Office that will handle both municipal violations and many times all or mist misdemeanors, this does not remove jurisdiction from the District Attorney's Office.
Charter cities have a statutory right under State law to prosecute their own municipal violations. But in many jurisdictions, it is not cost-effective and the city has instead contracted (under its general contracting powers) with the County for criminal prosecution services, to be provided by the District Attorney. The City may already be in a contractual relationship with the County because of the need for the services of the Public Defender for defendants charged with municipal violations.
Where there is a contract with the County, there are elaborate accounting methods utilized for charging the City for the "burdened costs" of the services, and reconciliation and payment occurs either annually or every other year.
This same contract powers capability is often used for various municipal services and can be for full services or for additional services on an as needed basis ("mutual aid"). Mutual aid compacts are common in So CA for RA services, fire safety, and other emergency responses and services.
"Contract cities," as they are denominated by the L A County District Attorney, do not maintain their own staffs of prosecutors. Where the D A has a conflict in an individual matter, the case will be taken over by the State Attorney General.
Over the past few decades, there has been a trend against prosecutions based on municipal code violations and, especially, against prosecution of muni code sections that allow for jail time. This largely reflects the economic considerations for the cities, but there are also significant policy and political considerations. The decision to abolish the local prosecutor in favor of contracting for the County DA is almost always on the political table in Los Angeles.
My responses to questions on Avvo are never intended as legal advice and must not be relied upon as legal advice. I give legal advice only in the course of an attorney-client relationship. Exchange of information through Avvo's Questions forum does not establish an attorney-client relationship with me. That relationship is established only by individual consultation and execution of a written agreement for legal services.