Entry to the Eurovision Song Contest is open to any Full member organisation of the European Broadcasting Union that pays the relevant fees. (It's technically the BBC that enters the competition, rather than the UK).
Full Membership of the EBU is open to broadcasters within Europe and surrounding territories (largely using the International Telecommunications Union's definition of 'Europe' for such purposes, as radio waves don't stop at national borders). So, for example, Jordan and Lebanon are both full members and entitled to participate. (Lebanon actually entered one year but got thrown out of the competition after refusing to broadcast Israel's entry).
The EBU also has Associate Members in many countries, including Australia, Bangladesh, Canada, the USA, Cuba and Japan. Those member organisations aren't normally allowed to participate in the Eurovision Song Contest but an exception was made in 2015 for Australia when, due to the popularity of the contest in that country, they were allowed to join in as part of the competition's 60th anniversary celebrations.
Australia then sought, and obtained, a contract with the EBU which allowed them to continue to participate until 2023. There's no new contract in place yet for 2024 onwards, so Australia's participation in future years is currently uncertain.