If the police wish to search you car or truck and you refuse, they can hold you to do it, even easier call the game warden anywhere in the state they have the right to search your vehicle anytime anyplace, looking for illegal game. If they find something then they now can turn you over to the officers on the spot.
At all places not under the border sphere of influence, when the police are asking if they can look in your vehicle you can decline the request. In fact, in order to even stop you (again, not border related) they must have, in order of increasing reliability, reasonable suspicion, probable cause, or direct observation of crime.
However, ANY irregularity (read minor violation, like taillight out or speeding) will give cause to stop, even if that is not the reason why they want to make the stop (this is called a pretextual stop). So, it usually is relatively easy to articulate that a stop is lawful.
But, once stopped and having dealt with the reason for the stop, there is no further way to detain unless they discover some other indication of criminal activity via the plain-sight or plain-smell test or you say something incriminating, EXCEPT if they ask you to allow a consent search.
So, if they neither see nor smell nor hear anything, and the stop was not due to some other narrow set of circumstances (such as a homicide or kidnapping witness describes a vehicle closely matching yours) the only LAWFUL way into your vehicle is to request you submit to a consent search.
As has been discussed here before, you do not have to agree to such a search and the officer must tell you that you are under no requirement to submit (however, this usually only occurs if someone asks if they have to allow the search). There is a frequently advanced opinion that refusing a request to search casts suspicion and may create a circumstance permitting further probing. It does not. The reason they are asking is precisely because they have no other legal means of going further into your affairs. An ample body of case law makes this very clear.
These kinds of searches begin very innocuously...you get a ticket or warning for speeding and then you are asked 'do you mind if I look in your trunk?' or some small variation designed to hopefully get you to agree. It's a valid technique and no LEO worth his pay would pass up the opportunity to take a peek.
As for me, I mind very much and the answer would be 'I do mind and no you're not looking'. All done very politely of course.
If you agree to a consent search, you have no further legal protection against any illegal evidence found. As also has been discussed, there are an incredible number of criminals who do agree to a consent search even though they know evidence will be found during same. It defies logic, but people do it all the time.