Yes, bots can connect to VPNs just like any other computer or device. In fact, using a VPN can be beneficial for bot owners as it helps to mask their true IP addresses and locations, making it more difficult for them to be detected or blocked by websites or services that they are accessing.
However, some websites may block access from known VPN servers in an effort to prevent automated traffic (bot traffic) from accessing their content. So while connecting through a VPN could help you avoid restrictions on your bot activities due to your location/geo-restrictions etcetera,it's important you check the terms of service of the website(s) you are targeting before proceeding with any automated activity.