"Sensor lock" really only has meaning in combat. Weapon ranges are all well within the sensor ones. Distant (300,000km, one light second) is stated in HG p.26 as the maximum practical distance at which attacks can be made.
There is no upper range limit on active radar and lidar... but you're only getting minimal detail on the target above Long Range. I'm not aware that minimal details prevents attacking; you resolve its basic outline. The range would be known, as would its motion. Knowing more about its shape or structure at Medium and Long range is handy, but doesn't affect your ability to burn it with a laser.
As far as using active radar on a distant star... yeah, there are practical reasons why that won't work.
In fact, there would be practical range limits on active radars, but it depends on the antenna size and reflected signal strength. You're probably okay to limit ship based radar/lidar to interplanetary distances, maybe about an AU or so. Bigger arrays - the sort of ones used for survey work - would do better. But keep in mind that passive thermal are good enough to give you bearing and aparrent motion. It's range that's the tricky part... but active sensors at least give you a cutoff. If there's no reflected signal within 16 minutes, it's either REALLY good at absorbing that wavelength, or further away than 1 AU. In most cases you'll have some idea of range from radar, but with rapidly increasing margins of error as distance gets greater.