If he stopped you for speeding he can seize whatever is in plain sight; for DUI he can search the unlocked portions of the car. If you consent he can search anywhere he likes. If he made up the DUI only after conducting a search on a speeding ticket the search was probably illegal. Get a good AZ lawyer to file a motion to suppress the evidence.
Why did he want to search your car in the first place? There is no easy answer to your question, and the only reliable way to get the information you need is to have an attorney who is working for you review the case. It may also require interviews of the police officers to adequately answer your questions. What court are you being charged in? What are the charges?
When the police pull you over, they must first have grounds for the stop. The constitutional requirement is for "Reasonable Articulable Suspicion," sometimes referred to as "grounded suspicion." However, if the stop is good, that is, if the stop was for speeding or running a red light, and the officer then smelled alcohol and thought your speech was slurred or there was other evidence of impairment (maybe a beer in the cup holder?) then he may have a basis to investigate further.
Case law says that when the police have "probable cause" to believe that you have been driving while impaired, then they can (1) arrest you, and (2) perform a "search incident to arrest." In addition, there is case law which basically says that, because your blood alcohol will decrease with time, there are "exigent circumstances" which would justify taking your blood.
It's kind of complicated, but as always, the police hold most of the cards.
Sign up to receive a 3-part series of useful information and legal advice about DUIs.