I’m not quite sure why your thread title says “sensor device” but your post discusses a desk lamp.
If you are asking if smartthings can respond to a light coming on, yes, it can. Any light that is known to the hub can be used to trigger other events in SmartThings.
As far as working locally, however, almost nothing works locally on SmartThings if the Internet is out. The one exception is the official smart lighting feature. That does have the ability to turn on light B if light A comes on, provided both lights A and B are using device type handlers which are eligible to run locally. We should also note that the SmartThings integration with the hue bridge will not work if the Internet is out. But smart bulbs which are paired directly to the smartthings hub may work locally.
Also it’s important to be aware that the SmartThings mobile app cannot talk to the hub unless the Internet is working, even if they are both on the same local network. The smartthings mobile app is a cloud-based application. It didn’t have to be written that way, but it was, so you will not have control through the mobile app if the Internet is not available to the hub.
OK, all of that said, you could use any pocket socket on your SmartThings network plugged into your existing outlet. And you could have that pocket socket turning on then trigger, say, an Osram Lightify smart bulb in a fitting on a different circuit to come on when the pocket socket came on. And that would work even if the Internet was down.
So that’s answering the question that was in your post. If you could give us more details of the specific use case we could help more on that one.
As far as a mains powered sensor, such as a motion or light sensor, that’s an entirely different question. So if that’s what you were looking for, let us know.