Is it ok for a business project to start it from scratch and write every piece of code from zero?
No, that's a terrible idea for the reasons you've already identified - you win business by getting your product or service into the marketplace. The way to do that is to use existing tools (whether they be open source or proprietary) where they are the right option and build the bits where there isn't a good option. Otherwise you're going to spend an enormous amount of time and effort building a buggy, less functional replacement for Spring, ASP.NET or whatever else while your competitors have already got your potential customers.
Taking this to extremes, are you going to write your own operating system, your own hardware drivers, your own compilers, and so on? No, because that would be stupid. So given that you're not going to write everything from scratch, don't worry about reusing application level code from other people as well.