Would it be illegal if I wrote my own "for dummies" ebook and sold it? i would be using their logo or anything just the site name and ebook name would include 'for dummies'
Wiley Publishing, Inc. owns the trademark "for dummies" and they are very aggressive in taking action against people who use it. The use, even without their logo, is asking for legal action.
how can you get sued just for asking a question is there any way i can get permission to use their trademark
It's highly unlikely they would grant you permission to use their mark - certainly not without reviewing your ebook and requiring you to pay a hefty licensing fee. The only way to know would be to contact them and ask.
Why not just change it up. Instead of selling a "for dummies" book, why not make a "for idiots" or "for dumbasses" book. If you take the insult to the level by using a synonym, you should be fine.
There isn't an easy search for all potential trademark issues on a mark - that is why there are companies you can pay to perform trademark searches for possible infringement. I believe being able to use "for idiots" for an ebook is going to depend on what your ebook is about and whether or not their is already an existing usage - i.e. there is a registered trademark for "webhosting for idiots" and I know there is prior usage on weight loss.
make a google search. Most high profile and TM'ed terms are owned by "good" companies with at least a "good" website presence on the net. Avoid those risks and try to create your own brand or something people haven't come out with or less popular. Example "Guides for DPians" or " Tutorial for dumbos" I know some people who even change the spelling just to get away with the TM. Though not sure if its that legal. Example like Nokia - Nokla Goodluck
Doing a google search isn't going to cover all your trademark issues. Its a very very small start I agree. But it is not comprehensive, if you are serious about investing the time and energy into the endeavor you are better off doing it right and saving yourself hassles down the line.