According to the list, no. Loiter mode requires GPS lock.
https://ardupilot.org/copter/docs/flight-modes.html#gps-dependency
Edit: I think I may have misread compass as GPS. System won’t let you arm if there is no compasses. But you may have a look at this compassless operation
.
https://ardupilot.org/copter/docs/common-compassless.html#gsf
I have not try this new feature but seems like it is acceptable. It uses IMU and GPS to estimate the yaw.