Yes, you can earn HawaiianMiles on codeshare flights operated by partner airlines within the same alliance.