It is possible to get a taxi at those hours. There may be a slightly longer wait than during daytime though. You can either take a taxi from those waiting, or order a taxi from one of the machines. Taxis usually have a fixed price to central Oslo. Ask about that before getting in the taxi. Drivers are legally required to tell you the price if you ask. Expect to pay at least 800-1000 NOK, since it's a rather long trip and Norway is an expensive country. Drivers usually prefer card over cash. Most standard debit cards (Visa, Mastercard) should be accepted. There is a lot of information about taxis on the airport taxi website: taxiguide
Taxis are safe, as long as it's a legitimate taxi. It should have proper taxi signs and a taxi meter and so on. Only legitimate taxis can be ordered from the machines, and only legitimate taxis can wait at the taxi stand.
As a cheaper alternative, you can take the train to central Oslo and a taxi from there. The airport express leaves every 20 minutes until 00.50 and only costs 190 NOK for an adult. It is designed to be comfortable for people with a lot of luggage. More information here: airport express