Do you mean if you wash pet bedding with borax? Probably it would kill fleas, as would using hot water and any detergent. If you mean sprinkling borax on bed bedding or carpeting or whatever and then letting pets lay on it, I wouldn't do that. If the animal ingested any of it, that would be bad for the animal.
Getting rid of fleas is a nightmare of a cleaning job. Lots of laundry, lots of bathing, lots of vacuuming, etc. The topical once-a-month applications available at places like PetSmart etc. are very effective. They work very quickly. The only down side is the cost. But don't waste your money on the cheap stuff. It didn't work for me.
Borax laundry detergent kills fleas. To kill fleas, sprinkle Borax on the affected surfaces and let it sit overnight. Vacuum up in the morning. Borax can also be used to kill roaches and ants. Borax is also referred to as sodium borate decahydrate, birax or sodium pyroborate.