I think this is fairly naive and depends a lot on your boss and company. I've worked at places where interviewing elsewhere is seen as disloyal. I know of places where giving your two weeks means getting escorted out on the spot.
I'm not saying these are great places to work, but they exist, and I bet they're not the minority.