Can you.....Yes, as long as the fittings at the box and pump are the correct size.
Should you...??? Maybe on a dedicated trail rig, but I would say no (others may agree/disagree). I would think you would have a higher chance of a leak. Not saying the stock hose can't be improved upon, but if you get a good quality stock replacement it will last a long time. It is also made for the application so it routes itself out of the way of harm (pulley's, belts, etc.).
If the hose is rated high enough and the clamping force is great enough, you could make your own, but I'm not sure I would.....to each his own I guess.
Legality might be a question too if it ever failed and somebody got injured/killed. Just a thought. Hope this helps