I am J1 visa scholar. My visa and DS 2019 is expiring on July 31. My return flight from Chicago to Chennai is on Aug 1 via London with a 2 hour layover. Will this be any problem in London or USA?
US visas are solely for entry, and the visa's expiration date just means the last day on which you can use that visa to enter. The visa's expiration date has no bearing on your ability to stay in the US. J1 are usually admitted for "D/S" on their I-94s, which means you remain in status indefinitely as long as you have a valid DS-2019 and comply with the requirements of J1 status. You remain in J1 status for 30 days after completing your J1 program. If your program completes July 31, you remain in status until August 30, so there is no problem if you leave August 1.
(Also, the US has no exit checks, so you would not have any problems leaving even if you overstayed; it may affect the next time you come to the US.)