Not only does blue seem to be the traditional color of police officer uniforms, but even things such as police lights are traditionally blue as well.
In england it was a deliberate choice to disassociate the police from the military.
London's Metropolitan police service was the first of it's kind, and established back when their military still wore the Red jacket uniforms commonly associated with napoleonic/american revolutionary english armies.
So it was a very important step that a strictly civilian preventive police force was being established for the first time, and they needed to make sure the public understood that this was not a military occupation and not any form of marshal law. So they went with a dark blue uniform.
Sir Robert Peel was the man largely responsible for establishing and running the very first iteration of the Metropolitan Police Service, and he made a lot of the sort of "design decisions" regarding organization, structure, uniform, methodology, and other aspects of the how the police force would be built and run. Look up the Metropolitan Police Act of 1829 for more information on the formation of the Met, which made it all official.
Official UK government site on the MPS: http://content.met.police.uk/Site/history
Ok, so, that's jolly old england which is not your question but it's still neat. Moving on;
Prior to 1830, we (america) didn't really have a centralized and regulated police force on any level. We didn't do a single big legal act like jolly old england, it happened more piecemeal. New York led the charge in 1854 by establishing the New York Police department and issuing it's officers with surplus union army uniforms, which were blue. Chicago and Boston followed soon after, and all being cities firmly within the Union, followed suit with the surplus blue uniforms. From there on tradition took over and here we are, at least in terms of blue uniforms.
The sherrif/deputiy system was much less uniform^couldn't ^resist due to how rural the areas they operated in were. Most of them simply wore normal clothes and had a badge that was displayed to signify their position.
As for Red/Blue lights on cars, a few things:
high contrast aspect, blue and red look nothing alike
less impact on eyesight at night
highly visible during both daytime and night. You may not see blue and red light being thrown during daylight but the siren itself is still extremely bright.
Sources: Miller, Wilbur R. Cops and bobbies: Police authority in New York and London, 1830-1870 (The Ohio State University Press, 1999)
Memoirs by the Right Honourable Sir Robert Peel (3 vol 1856-57)
TL;DR police departments started to become a thing around the Civil War, and officers started out being issued surplus union army uniforms which were blue. Fast forward 200 years and tradition.