I am currently studying in the UK with a visa on my Lebanese passport. If I want to travel to Portugal I will need a visa. Can I use my Australian passport to get out of the UK and visit Portugal and back? Am I allowed to do that?
Yes, you can travel, but you need to use both passports. This is going to be the third answer saying basically the same thing, but let me break it down into exact steps.
When leaving the UK:
You are now in Portugal! And on the way back:
This obviously assumes you have a multiple-entry UK visa that will let you back in the UK. Given the UK's lack of exit immigration, you could probably re-enter with your Australian passport (no UK visa needed) and they might never even notice you left, but I would not recommend it -- things would get hairy fast if they notice a hole in your story, eg. claiming to be a student but not having a student visa in your Oz passport.
The general rule about multiple passports is that you must always exit a country using the same passport that you used to enter. This implies that you cannot:
because at that point, you have "entered" the UK twice with two different passports and clearly you can only leave once more at this point.
If your UK visa is multiple-entry, then you should be able to re-enter the UK on your Lebanese passport in step 3 above after visiting Portugal on your Australian passport. If your UK visa is single-entry, then you would probably have to apply for a new visa or something before returning to the UK.
No, you are not allowed to do that. However, you do not need to enter Portugal on the same passport that you left the UK on.
Since your Australian passport won't have any UK visa or entry stamps, you can't leave the UK on it.
Conclusion: You need to leave the UK on your Lebanese passport.
The Portuguese customs, will not know (and don't even care) where you just came from. So you can enter Portugal on any of your passports, as long as you hold a valid visa in this passport (or are allowed to enter without a visa).
Conclusion: Enter and leave Portugal on whichever passport it's easier to enter the country.
Same on your way back: You need to leave Portugal on the same passport, that you entered it with. However, now you can enter the UK with any of your passports - as long as you hold a valid visa in this passport (or are allowed to enter without a visa). But since you are apparently studying in the UK and your student visa is in your Lebanese passport, you should enter on your Lebanese passport.
Entering the UK on your Australian passport will probably just get you a tourist visa, which most likely means you need to leave the country after a certain amount of time.
That said, make sure your Student Visa is a multiple entry one. If it isn't you will loose it by leaving the country - no matter which passports you are using anywhere.