It seems openttd does not allowed to join dock to railway station, only in separated way. Unfortunately.
If you build a station of one type (eg. dock) next to a station of a different type (eg. rail) the game will automatically join the two, provided that the combined station does not exceed the maximum permitted station size.
From version 0.7.0 onwards, if distant joining of stations is enabled in the advanced settings, you can hold down the
control key while placing a station near another station: the game will give you the option to combine the two stations if the resulting station will not exceed the maximum station size.
In both cases, the combined station will share a common pool of cargo and have a single approval rating for each cargo type, but will count as two (or more) stations for the purposes of the company performance rating score.