The short answer to the question "Can you heat up a vacuum?" is yes, but once you heat it up it's not strictly "vacuum". The notion of the vacuum that we use in modern quantum field theory refers to a region of space in which all of the quantum fields- electromagnetic fields, particle fields, gluon fields, etc.- are in their minimum energy states, or ground states.
Black-body radiation (otherwise known as radiative heat transfer) is a process by which an object of non-zero temperature equilibrates with the electromagnetic field. This type of heat transfer does not require an additional medium such as a gas or solid in the way that convective or conductive heat transfer does, so you are directly heating up the vacuum. Now, from a strict standpoint, once you transfer any heat into the vacuum, it is no longer in its lowest energy state and thus is no longer a vacuum, but this is pedantic from a practical perspective. Even the most empty regions of space are not at their lowest possible energy state- as you mentioned, space has a temperature of 2.7 K due to black-body radiation emitted by clouds of plasma when the universe was very young (if you're interested in this, look up the cosmic microwave background).
As far as the specific scenario with oxygen in a box, what happens is entirely dependent on the energy and number of moles of oxygen you use. If the oxygen is sufficiently hot when you dump it in, it will equilibrate with the box and either remain a gas or turn into a liquid or solid as appropriate. Over time, however, the box will equilibrate with the vacuum around it via radiative heat transfer, and the box and the oxygen inside it will reach 2.7 K.