It is way more complicated than just altitude, with zones and procedures, incredibly long checklists and a bit of maths. But a plane that can't reach 4000ft is probably in a mayday situation, and there is absolutely no time to try to dump fuel, it's a slow procedure.