Nozzle size and filliment

Does the filament determine the nozzle size? What is the criteria for selecting nozzle size?

Thanks for any help