Typically no, you can’t. Frames are made for either disc or rim brakes, and converting across is very expensive and very difficult to do. They do make conversion kits, but I wouldn’t recommend using these as they aren't very good and don’t work as proper disc brakes should. Your best bet is to sell the rim brake bike you have and replace it with a disc brake bike.