Would a Unity lens written for Unity 3D also work in Unity 2D?
I am thinking of writing a few lens features to link Unity into some business web applications, do I have to target both Unity variants separately or can I do one and assume the other will just work?
Yes, lenses are interchangeable between 2D and 3D.
Once installed on a system a lens will show up on either desktop. From a development standpoint you don't need to worry which one a user is using, Unity itself handles all that stuff for you.