Yes, Kumail Nanjiani (who plays Dinesh) grew up in Pakistan and moved to the U.S. for college. I believe Dinesh is also supposed to have grown up in Pakistan (albeit with a Hindu first name? Well, of course, even if rare, that can happen), and then immigrated to the U.S. as an adult. Hence, the accent.