Yes, you can use Joomla cache or some other third party cache plugins but you can't use the Joomla cache plugin.
The native Joomla cache plugin is made to cache the whole page output. This prevents the dynamic template switching by working correctly and as a result you may have mobile template showed to desktop users and conversely desktop template showed to mobile users in a mixed mode.
If you experiment such an issue, ensure that the Joomla cache plugin is unpublished. You can continue to use the standard Joomla cache enabled in global configuration.
As an alternative to the default Joomla! cache plugin, you can install and use the great plugin JotCache that offers the same feature but with a more advanced setup that allows you to manage 2 separate cache for desktop and mobile devices as visible in the image below.
JotCache for Joomla 2.5:
JotCache for Joomla 3: