They're supposed to be able to show up anywhere, unlike the other production order encounters. Looking at the code, it seems like that should work, but I've made a note to have a look at that to make sure, too.
The trader and military custom production require the colony to be producing some ships and in the case of the military one, to also be a military base.