My H1B visa is expiring on Sep 30th 2017 and I am planning to travel to India now. So When I travel back to USA my visa duration will be less than 6 months. Is that will create a problem during immigration checking in USA?
No, you should not have any problems when crossing US border.
Visa validity is determined by 22CFR 41.112. First paragraph states that The alien may use the visa in making application for admission for the entire period of validity of a nonimmigrant visa.