Although I wasn't familiar with this saying, it appears in Charles Doyle, Wolfgang Mieder, Fred R. Shapiro, The [Yale] Dictionary of Modern Proverbs (2012):
Don't ask a barber if you need a haircut.
1972 Daniel S. Greenberg, "Don't Ask the Barber Whether You Need a Haircut," Saturday Review: Science 55, no. 48 (Dec.) 58 (the article is subtitled "Greenberg's First Law of Expertise"). 1973 Arnold H. Vollmer, "The Numbers Game," in Environmental Impact: Proceedings of the ASCE Urban Transportation Division, Specialty Conference ... 1973 (New York: American Society of Civil Engineers) 85: "One of the basic laws of reasoning, discourse o argument can be summarized as 'Don't ask the barber whether you need a haircut.' Try though we may to be completely objective, there is no denying that an engineer has an an inherent bias toward and a vested interest in engineering." ...
So the expression goes back to 1972 (at least), is sometimes credited to Daniel Greenberg, and has attained the status of a modern proverb in the estimation of the Yale modern proverb collectors. I would caution you, however, never to ask someone who is publishing a collection of proverbs whether a particular saying is a proverb.
Malcolm Berko, "Broker Not to Blame for Bad Stock Picks" extends this advice to other fields:
I have a philosophy: never ask a painter if your house needs painting, never ask a lawyer if you should sue a defendant and never do business with a lawyer who advertises for business in newspapers, radio or TV.
Nevertheless, you should have no qualms whatsoever about asking strangers at English Language & Usage questions about English language and usage.