I have heard that as long as g of protein = g of carb then a person could maintain ketosis, but I don't think that's going to be true for most people. In fact, I think that the equation neglects what ketosis really is: a state of metabolism based on burning FAT (not protein) rather than carbs (glycogen)
Ketosis is based on FAT over carbs. If you get fat grams high and carb grams low, you'll go into ketosis and switch over to the fat burning metabolism that is ideal for O's. To do well in ketosis, you have to make sure that grams of protein are sufficient. But ketosis is based on fat being used by the body for fuel. protein helps in muscle repair and some minimal protein digestion and excretion does go on, but not much.
The danger in ketosis is that some dieters, conditioned by years of the media anti-fat campaign--will try to jack protein super high and keep both fat and carbs low. This can result in the body burning protein instead of fat for fuel. You'll know this is happening if your urine lets off a smell of ammonia. this is very dangerous and over the long term can lead to kidney/liver damage. The reason is that when protein is broken down too abundantly in digestion, a by-product is ammonia (which is why urine will smell of it), and you don't want ammonia being flushed through your kidneys. But if you keep fat high, your body will burn fat for fuel.
Based on a 1500 - 2000 calorie diet, I've always consumed at least 100 grams of fat per day while in ketosis (That's 900 calories from fat) I also ingest 0.75 grams of protein per pound of lean body mass. (I'm a woman. Men usually use 1.0 grams of protein per pound of lean body mass.) For me, that's 105 grams of protein, or 420 calories from protein. But if I ingested 105 grams of carbs I would come out of ketosis. I don't do any more than 40 grams of carbs on any given day. (160 calories from carbs) The only exception is if I "carb-up" (deliberately go out of ketosis in order to heighten my insulin).
I might go a little higher on protein or a lot higher on fat, but I really cannot reliably raise the limit on carbs beyong 40 grams or I drop out of ketosis. I suppose that there were times when I took in too many carbs right before a workout and never got out of ketosis, but it's not reliable.
If you are interested in this topic, you can view my web page in which I provide an overview of what goes on in the body when a person switches into ketosis. On my web page, I explain the physiology of what is going on in ketosis in fairly easy to understand terms, but I hit the major points.
The ketogenic diet is really only beneficial for weight loss when it incorporates exercise. Almost everybody does lose weight in the early stages, but there coms a point when execise is crucial and when theperson must still regulate calories. The benefit is that in ketosis you tend to be less hungry because insulin levels are low.