Indeed, naval units (surface ships at least, not subs--except for nuclear subs with missiles in them) can bombard land units if they're in range, all the way from the trireme onwards.
Edit: I'm more interested in whether land units can bombard ships, and if so, is there a penalty involved for accuracy? I imagine it would be pretty hard to hit a Greek-style combat vessel from shore with an ancient era catapult.