Yes, a deputy sheriff who is driving a partol car that has only one working head light can make a legal traffic stop and search of another vehicle assuming there is probable cause for the stop and later search.There is nothing in the facts that you have written about that the malfunctioning headlight might give cause for the dismissal of any arrest. If you have been arrested over the incident that you are writing about, I suggest that you consult with a criminal defense attorney. Good luck.