Sure you can,
in your test you have to implement such class which holds Appium Driver object.
once you check whether its IOS or Android you create a corresponded instance.
you use System.getProperty("os.name"); to retrieve the os you are running on
you will receive "Mac" or "Windows" , this way you get the platform.(Appium IOS works only on Mac, it needs the Xcode ).
For Windows the platform = "android" for Mac platform = "IOS"
then you use it
AppiumDriver _driver;
if (platform.equals("android"))
_driver = new AndroidDriver(new URL(mAppiumRemoteAccess), mCapabilities);
else
_driver = new IOSDriver(new URL(mAppiumRemoteAccess), mCapabilities);
then it does not matter what platform you use, you have one driver. now write you methods using the driver. use these methods within a test class.