Can I bypass a pull-cord switch by connecting the two wires?
Yes you can just connect those two wires with a rated connector and use the wall switch.

Optionally, you could just buy a new pull chain switch for a few bucks and install that.