Speaking in terms of past few decades to current generator hubs and lights, mostly they are interchangeable, with some qualifiers and exceptions.
Almost all current hubs and lights are based around 6 volt, 3 watt, and can all work together. Usually the deal is your hub is going to have its own connector type which it will probably come with, like the two-piece plastic plugs for Shimano or the spade connectors for Schmidt. Your light will either have an integral wire as in recent higher end B&M and Schmidt lights, or terminals for a wire with spade connectors, or in some cases a proprietary plug type with an included wire. It's going to be some type of two-strand wire regardless, which you'll then cut to length, prep as needed and connect to whatever kind of connector(s) the hub takes. Most lights come with wire but not all, and in some cases you'll have choices like getting the fancy Schmidt coax wire, which is excellent but a little more involved to prep.
There are some oddball 12v6w lights and hubs that won't play nice with others, and then there are some random things like the old Schmidt E6Z secondary light that would probably need some creative splicing to work with a Shimano plug, and there's probably some other miscellaneous exceptions. But the reason they're exceptional is that almost all of these lights are intended to be usable as upgrades or replacements on random bikes in the generator countries, and same deal with hubs being intended to drop in on existing bikes, so they're mostly very much intended to be cross-compatible.