A former Australian prime minister has said his country should be "prepared to make a contribution" to protect the freedom of Ukraine.