The term for a foreign carrier transporting passengers or goods on an entirely domestic itinerary is 'cabotage.' It is almost never allowed, anywhere.
It's theoretically (and sometimes practically) possible to ticket these 'tag' segments on an international ticket (e.g. flying Qantas LAX-SYD without immediately continuing on to Australia by booking it as part of a oneworld RTW) but you'll have to find a really savvy agent to ticket them; most won't even though they're technically legal as long as they're part of a single international ticket.