It depends on company and country. I know Norwegian and Air Berlin allow paying passengers to ride in the cockpit if they have a pilot's license. In UK airspace, this is not allowed for any company. Vueling allows non-crew to ride in the jumpseat with prior permission from the company, etc...