Yes, you can travel to Puerto Rico on an H1-B visa. Travel to PR is considered domestic travel just like traveling between any US mainland states.