You use a cane to support you and to help you keep your balance when you are walking. Therefore, if you are walking with a cane in a dream, you could require emotional support or be trying to balance different aspects of your life.
Canes are sometimes associated with punishment (caning). If you dream that you are being caned, you could be feeling guilty about something and using your dream as a means of punishing yourself.
If you dream that you are being beaten with a cane, you could be reliving a painful experience from your past that you have been repressing. Your dream is making you face the pain of your experience so that you can deal with it.
A dream that you are beating someone else with a cane can reflect repressed anger or frustration.