The EU rules (Regulation 261/2004, known as EU261) cover every flight that leaves an airport in the EU, Norway, Iceland or Switzerland, whatever the airline. So a flight from Frankfurt, Paris, Helsinki, Zurich or Amsterdam to Haneda or Narita is covered on Japan Airlines and ANA as well as on any European airline. Flights in the other direction, from Tokyo into the EU or Switzerland, are covered when the airline is European: licensed in the EU, Norway, Iceland or Switzerland, such as KLM to Amsterdam, Finnair to Helsinki, Swiss to Zurich, LOT to Warsaw or Iberia to Madrid from Narita.
The UK rules (UK261) work the same way for Britain: every flight leaving the UK is covered on any airline, and flights into the UK are covered on a UK or EU airline. A British Airways flight from Tokyo to London counts; a Japanese airline from Tokyo to London does not, while its flight from London to Tokyo does.
The journey counts from where it began. One booking from Europe with a change of plane outside the EU, such as Manchester to Tokyo via Istanbul, is covered from the first airport to the last, including a delay on the second flight, and the delay is measured on arrival at your final destination (Court of Justice rulings Wegener, C-537/17, and Folkerts, C-11/11). A return ticket is two journeys: the way home from Tokyo is judged on its own, by the airline that flies it.
These rules do not cover flights within Japan, or trips between Japan and the Americas or Asia, unless that same booking began in Europe. If you are flying from the US, Canada or Australia, your Tokyo flights are only covered when your journey started in Europe or you fly a European airline into Europe.