You can, you just need them to be on the same network.
I work with hikvision IP cameras.
Example pipe for gstreamer connection (gst-launch-1.0 command) for a hikvision camera (use h264 main stream not h264+)
rtspsrc location=“rtspt://user:password@192.168.1.16:554” latency=10 ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! autovideosink
If you want, you can use this string to open the camera in openCV (tested in c++ environment only)
rtspsrc location=“rtspt://user:password@192.168.1.16:554” latency=10 ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! appsink
Just make sure you change the IP to the IP of your camera in the network, and use the correct credentials to connect to it (user password combo)