The top circuit seems a bit suspect. If you apply a large enough input voltage for the Zener diode D2 to conduct, then the impedance driving the LEDs will be low; so the current through the LEDs will get very sensitive to the Zener voltage and to the LEDs' forward drops, and thus be poorly-controlled.
If you want to use a Zener to make the current through the LEDs vary less with the applied input voltage, then a resistor should be placed both between the input and the Zener, and between the Zener and the LEDs.
But that's probably not really necessary, except maybe to make the visible LED brightness more constant with applied input voltage. It's okay for the opto-isolator LED current to vary, as long as we stay below its maximum rated current, which is generally high (since that's limited by thermal effects, and the voltage drop is small, so the power V*I is small).
D1 probably isn't necessary, unless you're trying to guarantee that the opto-isolator stays off even for an input voltage above 0 V but below ~8 V (where that ~8 V is the Zener drop plus the LED drops). R2 and D2 would dissipate a little more power without D1, but it would seem easier to choose those components with appropriate power rating than to add an additional component.
The bottom circuit also seems suspect. The only thing that limits the current through the opto-isolator LED is Ib*hFE, and the current gain hFE for the transistor Q1 isn't well-controlled, and is in any case pretty big. At Vin = 24 V, for example, we're effectively applying a voltage (24 V)*(2.7k/(2.7k + 10k)) = 5.1 V through a Thevenin equivalent resistance of (2.7k || 10k) = 2.1k. The transistor drops Vbe ~ 0.7 V, for base current Ib = (5.1 V - 0.7 V)/2.1k ~ 2.1 mA.
In the datasheet for the MMBTA06, we see a rated minimum hFE of 100 around Ic = 100 mA; in that case, we'd expect Ic ~ 100*(2.1 mA) = 210 mA, which is much greater than the TLP283's rated absolute max LED steady-state current of 50 mA.
Either of these circuits may appear to work, but they're pretty bad; you may see unexpected variations in behavior over the production spread, or reliability problems. I would suggest starting with something like
http://cq.cx/interface.pl#4