If you are planing on the spray in liner, get that installed first. It needs to cure before putting in 5th wheel rails (if you are using bed rails). The rails can go over the liner. They can also spray around the rails, but it is just more prep work to do that.
If it is a plastic bedliner, they can get cut to fit around the rails. The rails can not installed over a plastic bedliner.
If it is a through the bed mount hitch, where you are just cutting holes in the bed, then it can be done however you want it done.