I can only speak for FAA, but you do not need a class 1 or 2 (the equiv to class 1 in EASA) for CPL or ATPL. You're not allowed to work (ie get compensation) without it, but you can hold them with a class 3.
The only scenario where you can directly get paid for your flying and still be on a class 3 medical is if you're an instructor (CFI, CFII). Indirectly, there are others. For instance, you can take aerial photographs in your own plane, sell them and make money on them, with a CPL and a class 3. Perhaps even with a PPL.