Why are MCP23017 (port extender) input pins high by default?

I am not sure if it can be handled in code

No, because the problem is before any code is run so there is nothing code can do to affect this.

or any resistor required between pin and positive +.(what should be the value of resistor)

Yes a resistor from 10K to 30K should ensure you have a weak logic one from power up. If you want a weak logic zero then connect it to ground.

However, I will agree with the others that knowing context would remove all the guess work from answers.