Why not? One is a verb and one is a noun, so while the words may be the same, the meanings are completely different. That is just one of those wonderful things about the English language; identical spelling but different meaning and use.
Quay and wharf are closely related to the noun "dock". One can dock a ship at a quay, wharf or at a dock.