As @Bill commented, both are correct. The only difference, that may come to mind is that you do not necessarily need to talk to your friend(probably, planning to pay a visit) when you use past tense.
Therefore, by using
I was wondering if he was available?
you are implying that you may or may not want to talk to the person.
I was wondering if he is available?
Here, you are sure that you'd talk to him if he is available.
Though, these might just be my own implications. In general sense, you can use either of them without anyone doubting it.
Or can I say either and still be grammatically correct?
As mentioned before, you'll be grammatically correct by using either of them.