You will have no problems, so long as your BKK-DXB isnt severely delayed. I wouldnt bother switching and having a 7 hour layover. If you were to miss the DXB-JFK flight due to delayed incoming flight from BKK, they will swap you onto the next available JFK flight and give you a hotel / meals etc