Totally legal to tune it up & use it. If it is a VORTAC, it will work just like every other VORTAC out there. If it is a TACAN, you may be able to get DME from it, but you won”t get bearing from it without a TACAN receiver.
Many, perhaps most VOR’s out there are in fact VORTAC’s — the TACAN station is colocated with the VOR. It is possible to have a VOR-DME station, which gives a civillian user everything a VORTAC does, but no bearing info to TACAN-only military aircraft. And you can have a VOR station with no associated DME at all.
But you won’t find any rule prohibiting you from tuning up any of the above - doesn’t exist (at least in the U.S., nor anywhere else I’ve ever heard of). If the military wanted a NAVAID they could use that you couldn’t, they could put up a TACAN using a channel that civillian DME receivers can’t pair with (ex ch 16X “pairs” to 135.9 - not a frequency in the range civil VOR receivers can tune to) and not publish it. But realistically, they’d probably just use a GPS coordinate & call it good.
(Edit: as @UnrecognizedFallingObject mentioned, it is not the “Y” TACAN channels that conventional VOR receivers can’t pair with, but there are some channels you can’t get DME from using normal VOR tuning — see this chart.)
Flying over that navaid on a military base may entail issues with the airspace involved, but that is its own issue, unrelated to using or not using the navaid.
Short answer: A VORTAC station combines a VOR-DME and a TACAN. It is the result of a cooperation between civil and military worlds to share the same DME (and the navaid place).
Civil aircraft use includes accessing the VOR part (civil), the DME part (civil and military), but not the TACAN bearing transponder, said otherwise they access the VOR-DME equivalent, or for what civilians are concerned, a VORTAC is a VOR-DME.
They are not equipped for receiving the TACAN bearing equipment, though nothing prevent them to be equipped with the related UHF receiver.
More details: A VORTAC station is composed of three signal generators:
- A VOR (VHF) signal used for civil bearing determination.
- A DME (UHF) signal used for range determination
- An UHF signal used for military bearing determination, in theory 9 times more accurate than a VOR.
DME and UHF bearing station components are interrogated by the aircraft, contrary to the VOR which broadcasts continuously.
When civilians use a VORTAC, they actually use the two first signals (VOR-DME). Military use the two last signals (TACAN) and the VOR as a backup if they are equipped, which is normally the case.
Pure TACAN have only the UHF bearing determination signal and the DME signal.