Not in BC (it is in other jurisdictions, like Quebec - in New York, you can wear headphones, only your left ear must be open). I've ridden by cops in Vancouver lots of times with earbuds on with not so much as a comment.
Some people claim its illegal according to the BC Motor Vehicle Act, but I'd be dammed if its actually in there
http://www.bclaws.ca/EPLibraries/bclaws_new/document/ID/freeside/96318_00
I suspect if there were a rash of accidents involving cyclists with earphones and cars, the AG definitely would look at making it an offense. You usually don't try to listen for cars around you when you drive, but does that make you a less safe driver? I can usually hear cars over the music (especially large vehicles) but my music is at a level that is typically no louder than the wind in my ears would normally be. I'm not saying its not a bad habit, but it often beats the boredom of commuting sometimes 10+ hours a week.
Hmm that is interesting. A friend of mine got two tickets in one go on her bike about a year back. One was for not fully stopping at a stop sign, the other was for wearing headphones. Im pretty sure you arent allowed earphones while driving a car (but one is OK I think?), so Im going to guess they can apply the same law to cyclists?